Sending extras to BroadcastReceiver

后端 未结 3 1604
独厮守ぢ
独厮守ぢ 2021-01-15 01:07

I have an Activity that runs the following code (time and interval are defined):

Intent buzzIntent = new Intent(getBaseContext(), BuzzReceiver.class);
Pendin         


        
3条回答
  •  天涯浪人
    2021-01-15 01:41

    Try following code

    Bundle bundle = intent.getExtras();
    int interval= bundle.getInt("interval", -1);
    

    instead of

    int interval = intent.getIntExtra("interval", -1);
    

提交回复
热议问题