发送广播

时间:2014-04-30 02:49:15   收藏:0   阅读:414

public void sendPlayStateBrocast()    
 {
  
  if (mContext != null)
  {
   Intent intent = new Intent(BROCAST_NAME);
   intent.putExtra(MusicPlayState.PLAY_STATE_NAME, mPlayState);
   intent.putExtra(MusicPlayState.PLAY_MUSIC_INDEX, mCurPlayIndex);
   
   if (mPlayState != MusicPlayState.MPS_NOFILE)
   {
    Bundle bundle = new Bundle(); 
    MusicData data = mMusicFileList.get(mCurPlayIndex);
    
    bundle.putParcelable(MusicData.KEY_MUSIC_DATA, data); 
    intent.putExtra(MusicData.KEY_MUSIC_DATA, bundle);
   }
   
  
   mContext.sendBroadcast(intent);
  }
  
  
 }

发送广播,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!