you can set up objects to implement functions in the Application.activitylifecyclecallbacks interface, and usePublic void registeractivitylifecyclecallbacks (Application.activitylifecyclecallbacks callback) The application function adds a proxy object to the.
The following code, for example, is called during the resume of all activity of this program.
@Override Public voidonactivityresumed (Activity arg0) {System.out.println ("The onactivityresumed of the" ... "...."); System.out.println ("~~~~~~~~~~~~test activity is" +Arg0.getclass ()); if(Arg0.getclass () = = Passcodeunlockactivity.class ) return; System.out.println ("Onactivityresumed ..." 111111 ..... "); if( ( This. applockdisabledactivities! =NULL) && Arrays.aslist ( This. Applockdisabledactivities). Contains (Arg0.getclass (). GetName ()))return; System.out.println ("Onactivityresumed ... 22222 ..... ... "); if(Mustshowunlocksceen ()) {//uhhh ohhh!SYSTEM.OUT.PRINTLN ("show lock .....") 4444 ..... "); Intent I=NewIntent (Arg0.getapplicationcontext (), passcodeunlockactivity.class); I.addflags (Intent.flag_activity_new_task); Arg0.getapplication (). startactivity (i); return; } }