I'm trying to display a Toast notification in verifyPasswordAndUnlock() in PasswordUnlockScreen.java whenever a user enters the wrong password. I wrote the following code, and built successfully.
Toast.makeText(getContext(), "Invalid password", Toast.LENGTH_LONG).show();
However, the Toast doesn't appear, because it actually appears in the home screen, which is invisible when the lock screen is on top. I verified this by having another Toast appear when the user successfully logs in, and that Toast only appears in the home screen after the Lock screen disappears
I suspect this is because getContext() returns the home screen's context. How do I get the Lockscreen's context? PasswordUnlockScreen.this doesn't even compile, and mContext and context both have the same problem as getContext()