android - AIRPLANE_MODE action not receiving -
Android Airplane mode is not showing the log
My code is below
public class increases main activity activity {@ override protected zero creation (InstanceState saved from bundle) {super.naught (savedinstenstate); SetContentView (R.layout.activity_main); IntentFilter intentFilter = new intent filter (ACTION_AIRPLANE_MODE); Register receiver (mBroadcastReceiver, intentFilter); // AppRater.app_launched (new WeakReference & lt; activity & gt; (this)); } @ Overhaired Protected Zero Destroy () {Super. Onesteroy (); UnregisterReceiver (mBroadcastReceiver); } Private Final Broadcast Receiver mBroadcastReceiver = New Broadcast Receiver () {@ Override Public Records on Receive (Context Reference, Intent of Intent) {Log D. ("Mass", "Action" + Intent. Gate Action ()); If (intent.getAction (.) Equal (ACTION_AIRPLANE_MODE)) {mHandlerRedrawUI.sendEmptyMessage (UPDATE_VISIBILITY); }}}; Private static final full UPDATE_VISIBILITY = 1; Private static final string ACTION_AIRPLANE_MODE = "android.intent.action.AIRPLANE_MODE"; Handler mHandlerRedrawUI = new handler () {Public Zero handles (android.os.Message msg) {if (msg.what == UPDATE_VISIBILITY) {}}};
}
I just turned on airplane mode and can not find my log receiver
like
& lt; Receiver Android: name = "com.example.bootreciever" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.AIRPLANE_MODE" /> & Lt; / Intent-Filter & gt;
Comments
Post a Comment