Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android:configChanges seems to be ignored

I try to prevent that onCreate() is called when rotating the device. To reach this goal I followed the documentation and added

<activity android:name=".TabActivity"
          android:label="@string/app_name"
          android:configChanges="orientation">
     <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
</activity>

to the manifest. After that I inserted this to the Activity's source code:

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
}

But it seems like Android ignores this method. A breakpoint which I set here is never reached.

What's my fault here? Is this a problem when using tabs?

Regards!

like image 563
J H Avatar asked Aug 30 '11 08:08

J H


1 Answers

Try this:

  android:configChanges="orientation|keyboardHidden"
like image 113
Bart Blommaerts Avatar answered Nov 07 '22 14:11

Bart Blommaerts