我收到错误:
Error:(109, 18) error: non-static method getIntent() cannot be referenced from a static context
Run Code Online (Sandbox Code Playgroud)
在线上:
init(getIntent().getSerializableExtra(Const.EXTRA_DATA));
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
public static class Upper_fragment extends Fragment {
private static final String TAG = "PlayActivity";
private Video vid;
int mSavedVideoPosition;
protected VideoPlayerInterface vidp;
private LocalSingleHttpServer mServer;
// to be implemented in concrete activities
public Cipher getCipher() throws GeneralSecurityException {
final Cipher c = Cipher.getInstance("AES"); // NoSuchAlgorithmException, NoSuchPaddingException
c.init(Cipher.DECRYPT_MODE, new SecretKeySpec("abcdef1234567890".getBytes(), "AES")); // InvalidKeyException
return c;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle …Run Code Online (Sandbox Code Playgroud) android ×1