I already tried onWindowFocusChanged, onLayout callback but it doesn't get called when lock/unlock device very quickly
Asked
Active
Viewed 69 times
0
-
Can you explain *"device unlock for ViewGroup"*? Do you just want to know when the device is unlocked? [This *might* be what you are looking for](https://stackoverflow.com/questions/3446202/android-detect-phone-unlock-event-not-screen-on) – codeMagic Dec 18 '17 at 19:40
-
@codeMagic I need to know what method is called after lock and unlock the device in ViewGroup itself – rabit Dec 19 '17 at 03:25
-
If your activity is open, then onResume should run – codeMagic Dec 19 '17 at 03:35
-
@codeMagic I am asking the callback of ViewGroup, actually onWindowFocusChanged or onLayout gets called when press lock/unlock button slowly but not get called when press it very quickly – rabit Dec 19 '17 at 08:16
1 Answers
0
Try using your Activity's life cycle callback methods. When the device is unlocked, onResume()
is called as your Activity is becoming visible.

Sergey Emeliyanov
- 5,158
- 6
- 29
- 52
-
I have built custom view using FrameLayout and need to set bitmap to image view again when device is unlocked – rabit Dec 19 '17 at 03:28