Current :
Toast toast = Toast.makeText(context, "test", Toast.LENGTH_SHORT).show();
The Toast was showed on Idle Screen. But it does not appear on Lock Screen.
I want to show Toast on Lock Screen. How..?
Current :
Toast toast = Toast.makeText(context, "test", Toast.LENGTH_SHORT).show();
The Toast was showed on Idle Screen. But it does not appear on Lock Screen.
I want to show Toast on Lock Screen. How..?
I meet the same problem. I added TextView
to my Activity's View, replacing Android Framework's Toast. That is to say: I implemented Toast by myself.
TextView mCustomToast = (TextView)findViewById(R.id.tv_custom_toast);
/**
* show custom toast:
* fix the problem that {@link android.widget.Toast} can't show when screen be
locked
*/
private void showCustomToast() {
if (mCustomToast != null) {
if (mCustomToast.getVisibility() == View.VISIBLE) {
return;
}
mCustomToast.setVisibility(View.VISIBLE);
mCustomToast.postDelayed(new Runnable() {
@Override
public void run() {
mCustomToast.setVisibility(View.GONE);
}
}, 1000);
}
}