简体   繁体   中英

Android Screen Orientation

I am using both landscape and portrait for an application.

My problem is,whenever i rotate the screen,the TTS I am using in my application automatically

starts from first.

How do I solve this problem?

By default, Android restarts/recreates the activities whenever the orientation change.

You will need to save your data/state by calling onSaveInstanceState() before Android destroys the activities.

Have a look at Handling Runtime Changes

As the last resort, you could prevent this by adding android:configChanges="orientation" to your activity in AndroidManifest file.

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