notification用Intent传值的时候如果收不到,可以用bundle来传。
发送notify:
Intent intent=new Intent(this,MainActivity.class); Bundle bundle=new Bundle(); bundle.putString("lvbo","result"); intent.putExtras(bundle);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
在
onNewIntent接收
@Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent);
String result=getIntent().getExtras().getString("lvbo");
}