How can I disable navigation keys via Service in Android? I had been thinking about adding FLAG_FULLSCREEN or FLAG_LAYOUT_IN_SCREEN to WindowManager
in order to make a service go fullscreen, but it didn't work. Next thing I did trying to disable TypeGuard, but no luck. Anyone worked with KeyguardManager because it might solve the problem? Thanks in advance!
Asked
Active
Viewed 67 times
0

jelic98
- 723
- 1
- 12
- 28
1 Answers
0
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
And add permission <uses-permission android:name="android.permission.DISABLE_KEYGUARD"></uses-permission>
in AndroidManifest.xml.
OR
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);

jaibatrik
- 6,770
- 9
- 33
- 62

Gil Snovsky
- 210
- 2
- 6