When the Android Gallery plays the slide, press power key to screen and then highlight the Keyguard_android

Source: Internet
Author: User
When you play the slide show, press the power button to kill the screen and then the screen, and you will see that the slide continues to play without displaying the keyguard. How to display the Unlock interface after the screen is lit.

The modified method is to remove the flag_show_when_locked sign bit, the change location on the ICS2, JB and JB2 is slightly different.

1, in the ICS2 and JB version, modify the Gallery2\src\com\android\gallery3d\app\activitystate.java file Screen_on_flags, as follows:
Copy Code code as follows:

private static final int screen_on_flags = (
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
// | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
);

2, on the JB2 version, modify the Alps\packages\apps\gallery2\src\com\android\gallery3d\app\slideshowpage.java OnCreate () method:
Copy Code code as follows:

public void OnCreate (Bundle data, Bundle restorestate) {
Super.oncreate ( data, restorestate);
//Mflags |= (Flag_hide_action_bar | Flag_hide_status_bar
//| flag_allow_lock_while_screen_on | flag_show_when_locked);
Mflags |= (Flag_hide_action_bar | Flag_hide_status_bar
| FLAG_ALLOW_LOCK_WHILE_SCREEN_ON);
...
}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.