Pregunta

I am having trouble detecting airplane mode enabled/disabled on honeycomb, the following broadcast receiver works fine on all versions/sets other than android 3.0/ honeycomb/tablets..

<receiver android:enabled="true" android:name=".ConnectivityReceiver">
<intent-filter>
    <action android:name="android.intent.action.SERVICE_STATE"/>
</intent-filter>
</receiver>     

Thanks

¿Fue útil?

Solución

You could directly poll if you are having problems

  private static boolean isAirplaneModeOn(Context context) {

        return Settings.System.getInt(context.getContentResolver(),
                Settings.System.AIRPLANE_MODE_ON, 0) != 0;

    }

Or use ACTION_AIRPLANE_MODE_CHANGED

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top