Handle screen rotation without losing data – Android

In Activity Tag of Manifest you should have to mention

<activity
        android:name="com.example.ListActivity"
        android:label="@string/app_name" 
        android:configChanges="keyboardHidden|orientation">

If you are using Android 2.3(API level 13 ) and above use

<activity
        android:name="com.example.Activity"
        android:label="@string/app_name" 
        android:configChanges="keyboardHidden|orientation|screenSize">

It should have to work.

It will work only with activity tag and not with application tag

Leave a Comment

tech