Hi,
I am trying to determine if the device is in airplanemode when my
activity starts. I did not see a setting that exposed this but did
see a way to set up a broadcast receiver to be notified. After coding
the receiver I never see my code getting loaded or called when I put
the device into and out or Airplane mode. Here is the code I am using
and the setting I placed in my app manifest. If someone could take a
look at let me know what I am doing incorrectly I would really
appreciate it.
thanks.
<!-- Broadcast Receiver that will process be notified of
changes in AirplaneMode -->
<receiver
android:name="com.myapplication.AirplaneModeBroadcastReceiver" >
<intent-filter>
<action
android:name="android.intent.action.AIRPLANE_MODE_CHANGED" />
</intent-filter>
</receiver>
package com.myapplication;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class AirplaneModeBroadcastReceiver extends BroadcastReceiver {
private static final String TAG = "AirplaneMode";
@Override
public void onReceive(Context ctx, Intent intent) {
Log.d(TAG, "onReceive");
// Do something...
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---