Android popwindow solves the problem that the UI on the OpenGL stack is overwritten.

Source: Internet
Author: User

1. Initialization

Context mcontext = sdmusicplaybackactivity. This;

Layoutinflater mlayoutinflater = (layoutinflater) mcontext
. Getsystemservice (layout_inflater_service );
Mseekview = mlayoutinflater. Inflate (R. layout. pop_seek, null );
Mseekpopupwindow = new popupwindow (mseekview, 800, 50 );

// Create the timer
Timer timer = new timer ();

Timer. Schedule (New initpopupwindow (), 1000 );

2. Private class initpopupwindow extends timertask {
@ Override
Public void run (){
Message message = new message ();
Message. What = 30;
Mhandler. sendmessage (Message );
}
}
Public void showpopupwindow (){
Mseekpopupwindow. showatlocation (findviewbyid (R. Id. id_sd_mediaplay), gravity. Bottom, 0,100 );
}

3. Pay attention to adjust the display time according to the specific time when the message is sent to popupwindow. If the time is less than the overwrite time, the time will be enough after the 3D display is complete. Use the timer to solve the pop-up popupwindow phenomenon.

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.