How to disable Home button without using the TYPE_KEYGUARD?

后端 未结 7 1505
滥情空心
滥情空心 2020-12-24 03:58

i create a lockscreen application and i need to disable a home button, so if that phone is stolen, that phone can\'t be accessed.. my lockscreen is a fullscreen activity.. i

相关标签:
7条回答
  • 2020-12-24 04:57

    It's very simple, you should disable keyguard in the onAttachedToWindow() method:

    KeyguardManager keyguardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
    KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
    lock.disableKeyguard();
    
    0 讨论(0)
提交回复
热议问题