I have a TestActivity
. This activity will be started from a Main activity upon a Button
press.
This is how my Test Activity is declared in the manifest file.
<activity
android:name="com.example.MyTestActivity"
android:configChanges="keyboard|keyboardHidden"
android:label="MYTESTACtivity"
android:theme="@style/someTheme"
android:windowSoftInputMode="stateHidden|adjustPan" >
</activity>
Now the problem is, once the TestActivity
screen is shown, if I do an orientation change, then the instance count of TestActivity
is increasing by 1. If I again change it to Portrait mode, it is increasing by 1 more. This is how the instance count keeps on raising during Orientation Changes.
Please advice how to make just one activity instance at a time no matter what the orientation changes are.
Also I have tried adding android:launchMode="SingleTop"
still same issue is present.
FYI, This is how I am able to find the instance count with strict mode.
01-02 01:39:48.855: E/StrictMode(21992): android.os.StrictMode$InstanceCountViolation: class com.example.MyTestActivity; instances=20; limit=1