简体   繁体   中英

Android: Lock Portrait mode for 5 seconds then allow screen orientation change

Is this possible? I currently have intent that is activated when the orientation changes but after some testing it is a problem if the phone is in landscape mode when going the new class.

I don't see why not. You would need to do it programmatically though. My first thought is to create an activity with a runnable. In your onCreate, lock the orientation that you want and kick off the runnable thread. In the runnable thread, wait 5 seconds and then unlock the orientation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM