0
我對Android編程非常新穎。我想知道是否可以使用PendingIntent添加額外的參數?如何將參數添加到PendingIntent中
例如,我想在PendingIntent中做一些類似intent.putExtra(「test」,key)的東西。可能嗎 ?
我對Android編程非常新穎。我想知道是否可以使用PendingIntent添加額外的參數?如何將參數添加到PendingIntent中
例如,我想在PendingIntent中做一些類似intent.putExtra(「test」,key)的東西。可能嗎 ?
您可以在意圖中添加參數。
Intent intent= new Intent(context, YourActivity.class);
String displayName = "abc"
intent.putExtra("name", displayName);
PendingIntent pendIt = PendingIntent.getActivity(context,
TxrjConstant.REQUEST_READ_NOTIFICATION,
intent, PendingIntent.FLAG_UPDATE_CURRENT);