PendingIntent not opening Activity in Android 4.3

前端 未结 2 1861
北海茫月
北海茫月 2020-12-24 06:27

In my Service, I open up a notification on normal run, using this code:

private final static NOTIFICATION_ID = 412434;
private void startNotific         


        
2条回答
  •  时光说笑
    2020-12-24 06:43

    That's worked for me:

    Random randomGenerator = new Random();
    int randomInt = randomGenerator.nextInt(100);
    contentIntent = PendingIntent.getActivity(this, randomInt, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    

提交回复
热议问题