我正在尝试通过在密码验证完成后在 PasswordUnlockScreen.java 文件中显示 Toast 通知来修改 Android 框架。我在 verifyPasswordAndUnlock() 中添加了以下代码行
Toast.makeText(getApplicationContext(), "Verifying password", Toast.LENGTH_LONG).show();
但是,我收到构建错误:
frameworks/base/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java:166: cannot find symbol symbol : method getApplicationContext()
location: class com.android.internal.policy.impl.PasswordUnlockScreen
Toast.makeText(getApplicationContext(), "Verifying password", Toast.LENGTH_LONG).show();
我应该使用什么作为上下文而不是 getApplicationContext()?
谢谢!