How do I get android lockscreen package name

后端 未结 3 1178
遇见更好的自我
遇见更好的自我 2021-01-14 15:47

Is there a way to get the android lockscreen package name?

I want to show alert on the lockscreen using AlertDialog.Builder. So I need to know when the

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-14 16:33

    Found a native solution. After you build the Alert dialog and before showing it, apply this:

    AlertDialog alertDialog = new AlertDialog.Builder(context).create();
            alertDialog.getWindow().setType(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
            alertDialog.show();
    

    This will show the dialog on top of the lock screen.

提交回复
热议问题