当前位置:   article > 正文

Android5.1FM模块学习----向前台发送消息_notifyactivitystate

notifyactivitystate

1.  描述:当FM service监听到某个Receiver,需要前台更新UI时

2.  实例:手机切换飞行模式,

  1. //dongyang.li add for airplane mode.
  2. if(getAirplaneMode(getApplicationContext())) {
  3. mIsPowerUping = false;
  4. bundle = new Bundle(5);
  5. bundle.putInt(FmRadioListener.CALLBACK_FLAG, FmRadioListener.MSGID_AIRPLANE_MODE);
  6. bundle.putBoolean(FmRadioListener.FLAG_AIRPLANE_MODE, true);
  7. notifyActivityStateChanged(bundle);
  8. return;
  9. }




  1. private class FmServiceBroadcastReceiver extends BroadcastReceiver {
  2. @Override
  3. public void onReceive(Context context, Intent intent) {
  4. String action = intent.getAction();
  5. String command = intent.getStringExtra("command");
  6. if(Intent.ACTION_AIRPLANE_MODE
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/250882
推荐阅读
相关标签
  

闽ICP备14008679号