Android in full screen first touch screen no event triggered

Source: Internet
Author: User

a, the way to set up a full screen is not much to say, the following two kinds of common (record for memo):

1, set in the Androidmanifest.xml file, such as:

<activity android:name= "com.yeertc.android.RoomActivity" Android:theme= "@android: style/ Theme.NoTitleBar.Fullscreen"android:screenorientation=" Landscape ">

</activity>

2, in response to activity in OnCreate inside do add the following code

GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);// Be sure to put it before Setcontentview ()

B, this set of full screen will cause the following problems:

When you set some listener events in the corresponding activity component, the first touch of the screen does not trigger events in the component, which is a serious bug.

The cause of the bug is as follows:

The first time you touch the screen, regardless of whether it is set to full screen, the system will use the event to display the status bar (when the full screen is set to show the status bar of the action is only not shown), but not to trigger our monitoring.

This should be a bug in the system.

Remedial measures :

Set the following method in the corresponding component (View) from

Setsystemuivisibility start
The URL is as follows (FQ):
http://www.techrepublic.com/article/give-android-users-an-immersive-experience-by-using-kitkats-full-screen-decor-flags/

Note: This method is not for multiple models, some custom systems may have problems, such as Huawei

Android in full screen first touch screen no event triggered

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.