SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void registerAudioHandle()
  2.     {
  3.         BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver(){
  4.  
  5.             @Override
  6.             public void onReceive(Context context, Intent intent){
  7.                 Toast.makeText(context, "Message is: "+ intent.getStringExtra("message"), Toast.LENGTH_LONG)
  8.                         .show();
  9.                 String action = intent.getAction();
  10.                 switch (action){
  11.                     case "вверх":
  12.                         Log.println(Log.DEBUG,"MainActivity","MainActivityRecieve:"+action);
  13.                         break;
  14.                 }
  15.             }
  16.  
  17.         };
  18.  
  19.         IntentFilter filter = new IntentFilter("вверх");
  20.         registerReceiver(mBroadcastReceiver,filter);
  21.     }
  22.  
  23.     @Override
  24.     protected void onResume() {
  25.         registerAudioHandle();
  26.         super.onResume();
  27.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top