DevAndro
DevAndro

Reputation: 205

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?

Upvotes: 0

Views: 141

Answers (1)

Rahul
Rahul

Reputation: 45060

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.

Upvotes: 1

Related Questions