开发者

Screen Locks Continuously

开发者 https://www.devze.com 2023-04-11 04:46 出处:网络
I made a application to lock the screen. I write a code to lock the screen in 开发者_如何学JAVAa onCreate() method of activity,

I made a application to lock the screen. I write a code to lock the screen in 开发者_如何学JAVAa onCreate() method of activity,

Here the screen is locked correctly, but as I run application it locks the screen, now when I unlock it, it again shows the activity and then again lock the screen, so I can not do anything no what should I do.

WindowManager.LayoutParams params = getWindow().getAttributes();
params.screenBrightness = 0;
getWindow().setAttributes(params);


I dont think ur application is actually locking the screen. Its just turnig it OFF. When u try to unlock the screen, the screen is turning ON( due to user interaction ). As ur application is still running its forcing the sceern to turn OFF again. Just a wild guess, sorry if i mk completely wrong!!

0

精彩评论

暂无评论...
验证码 换一张
取 消