1

guys. I'm developing a applock application, when the service listen a locked app, it will use WindowManager to call addView() to add a gesture lock view. However, it doesn't work on MIUI System. And I find the reason is that when the service add a view, the MIUI system will remove the view so that I can't lock any app. I hope someone can help me, thanks!

Jospehus Chou
  • 117
  • 1
  • 10

2 Answers2

5

MiUI doesnt allow to add view due to its internal security. To solve your problem, go to App Setting > App > Calley > Permission Manager > Display Popup Window > Allowenter image description here

But this is manual way to allow add view method. You need to set it through code. Hope this helps you.

devendrant
  • 451
  • 3
  • 10
0

use WindowManager.LayoutParams.TYPE_TOAST, if you check android source code, you will find that when you using this type, there is no permission check.

Shaw
  • 1,445
  • 16
  • 21