PendingIntent get requestCode

前端 未结 1 1993
一向
一向 2021-01-12 02:33

I use an AlarmManager to start a service. When i set up the AlarmManager i use the PendingIntent and use a unique requestCode which is

相关标签:
1条回答
  • 2021-01-12 02:59

    You need to put lecture.getId() into extras of your myIntent. According to Javadoc requestCode is not even used yet.

    // store id
    myIntent.putExtra("id", lecture.getId());
    
    // read id or -1, if there is no such extra in intent
    int id = myIntent.getIntExtra("id", -1);
    
    0 讨论(0)
提交回复
热议问题