title: onConfigurationChanged not called at rotation with configChanges="keyboardHidden|orientation" set?
body: <p>I'm not the first one to have problems with getting onConfigurationChanged called at rotation. But since the common solution is to set configChanges="keyboardHidden|orientation" 
  in the manifest, and that does not help me, I posting this question regardless of the thousands of “similar” ones. </p>
  
  <p>This is a simple widget that turns the ringer volume on and off when clicked. It works fine until the screen is rotated, after that nothing happens on click.</p>
  
  <p>To deal with this issue I want to catch onConfigurationChanged, but it never gets called!
  I never get to see the log message from  onConfigurationChanged, I do however see another message in the log “I/ActivityManager(   63): Config changed: ” indicating that the configuration gets changed and that it would be reasonable to expect a call to onConfigurationChanged.</p>
  
  <p>Please help :)</p>
  
  <h2>Manifest:</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;  
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"  
      package="aa.android.x10.mini.mywidget" android:versionCode="1"  
      android:versionName="1.0"&gt;  
  &lt;application android:icon="@drawable/icon" 
               android:label="@string/app_name"&gt;  
  
      &lt;receiver android:name="MyWidgetProvider" android:label="My Widget"&gt;  
          &lt;intent-filter&gt;  
              &lt;action android:name="android.appwidget.action.APPWIDGET_UPDATE" /&gt;  
              &lt;action android:name="android.appwidget.action.ACTION_BATTERY_CHANGED" /&gt; 
          &lt;/intent-filter&gt;  
          &lt;meta-data android:name="android.appwidget.provider"  
                     android:resource="@xml/widget_info" /&gt;  
      &lt;/receiver&gt;  
      &lt;service android:name=".UpdateWidgetService"
               android:configChanges="keyboardHidden|orientation"&gt;&lt;/service&gt;  
      &lt;activity android:name=".Test"&gt;&lt;/activity&gt;  
  
      &lt;/application&gt;  
      &lt;uses-sdk android:minSdkVersion="7" /&gt;  
  
  &lt;/manifest&gt;   
  </code></pre>
  
  <hr>
  
  <p>WidgetProvider:
      package aa.android.x10.mini.mywidget;</p>
  
  <pre><code>import android.app.PendingIntent;  
  import android.appwidget.AppWidgetManager;  
  import android.appwidget.AppWidgetProvider;  
  import android.content.Context;  
  import android.content.Intent;  
  import android.util.Log;
  import android.widget.RemoteViews;  
  
  public class MyWidgetProvider extends AppWidgetProvider 
  {   
  @Override  
  public void onUpdate(Context context, AppWidgetManager appWidgetManager,  
          int[] appWidgetIds) 
  {  
      Log.i("MyWidgetProvider onUpdate", "#### CALLED!");  
  
      RemoteViews remoteViews = new RemoteViews(context.getPackageName(),  
              R.layout.widget_layout);  
      Intent intent = new Intent(context.getApplicationContext(), UpdateWidgetService.class);  
      intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);  
  
      PendingIntent pendingIntent = PendingIntent.getService(context.getApplicationContext(), 0, intent, 
                                                              PendingIntent.FLAG_UPDATE_CURRENT);
  
      remoteViews.setOnClickPendingIntent(R.id.TextView01, pendingIntent);  
  
      appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);  
  
      context.startService(intent);  
      }  
  }  
  </code></pre>
  
  <hr>
  
  <p>Service:
      package aa.android.x10.mini.mywidget;</p>
  
  <pre><code>import android.app.Service;
  import android.appwidget.AppWidgetManager;
  import android.content.Intent;
  import android.content.res.Configuration;
  import android.media.AudioManager;
  import android.os.IBinder;
  import android.util.Log;
  import android.widget.RemoteViews;
  
  public class UpdateWidgetService extends Service 
  {  
  @Override  
  public void onStart(Intent intent, int startId) 
  {  
      Log.i("UpdateWidgetService", "#### CALLED!");  
  
      String state = null;  
  
      AudioManager mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
  
      if (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL )
      {
          mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
          mAudioManager.setStreamVolume(AudioManager.STREAM_RING,mAudioManager.getStreamMaxVolume(AudioManager.STREAM_RING),AudioManager.VIBRATE_SETTING_ON);
          state = "ON"; 
      }
      else
      {
          mAudioManager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
          mAudioManager.setStreamVolume(AudioManager.STREAM_RING,0,AudioManager.VIBRATE_SETTING_ON);
          state = "OFF"; 
      }
  
      AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this.getApplicationContext());  
  
      int[] appWidgetIds = intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS);  
      if (appWidgetIds.length &gt; 0) 
      {  
          for (int widgetId : appWidgetIds) 
          {  
              RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.widget_layout);  
              remoteViews.setTextViewText(R.id.TextView01, "\n" +"         "+ state);  
                  appWidgetManager.updateAppWidget(widgetId, remoteViews);  
              }  
              stopSelf();  
          }  
          super.onStart(intent, startId);  
      }  
  
      @Override  
      public IBinder onBind(Intent intent) 
      {  
          return null;  
      }  
  
      @Override 
      public void onConfigurationChanged(Configuration newConfig) 
      { 
          Log.i("onConfigurationChanged", "##### CALLED! #####");  
          super.onConfigurationChanged(newConfig);
      }
  }  
  </code></pre>
  
  <hr>
  
  <p>Log when rotating the screen:</p>
  
  <pre><code>I/WindowManager(   63): Setting rotation to 1, animFlags=0 
  I/ActivityManager(   63): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/1 nav=3/1 orien=2 layout=17} 
  I/UsageStats(   63): Unexpected resume of com.android.launcher while already resumed in com.android.launcher 
  </code></pre>