如何在单击时将通知更改为其他通知-android

如何在单击时将通知更改为其他通知-android,android,notifications,push-notification,android-notifications,notificationmanager,Android,Notifications,Push Notification,Android Notifications,Notificationmanager,我的应用程序是为了显示一个通知,这很像一个提醒。到目前为止,我可以在通知框中显示我的文本。但我希望它在用户单击时切换到另一个通知 这是我的密码:else{ Text = "go to shopping mall"; Text2 = "meet emma"; final PendingIntent pending = PendingIntent.getActivity(arg0.getContext(), 0, new Intent(arg0.getContext(),M

我的应用程序是为了显示一个通知,这很像一个提醒。到目前为止,我可以在通知框中显示我的文本。但我希望它在用户单击时切换到另一个通知

这是我的密码:else{

  Text = "go to shopping mall";
  Text2 = "meet emma";
 final PendingIntent pending = PendingIntent.getActivity(arg0.getContext(), 0, new         Intent(arg0.getContext(),MainActivity.class), 0);
new AsyncTask<Void, Void, Void>(){

    public Void doInBackground(Void... args){


        Bitmap bmp = BimapFactory.decodeResource(arg0.getContext().getResources(), R.drawable.image);

        notification = new NotificationCompat.Builder(arg0.getContext())
         .setContentTitle("I want to...")
         .setContentText(Text)
         .setContentIntent(pending)
         .setSmallIcon(R.drawable.ic_launcher)
         .setStyle(new NotificationCompat.BigPictureStyle()
             .bigPicture(bmp))
         .build();
        notificationmanager = (NotificationManager)arg0.getContext().getSystemService(Context.NOTIFICATION_SERVICE);

        notificationmanager.notify(notificationId, notification);
        notificationId++;
        return null;
    }
}.execute();
Text=“去购物中心”;
Text2=“见艾玛”;
final PendingIntent pending=PendingIntent.getActivity(arg0.getContext(),0,新意图(arg0.getContext(),MainActivity.class),0);
新建异步任务(){
公共Void doInBackground(Void…args){
位图bmp=BimapFactory.decodeResource(arg0.getContext().getResources(),R.drawable.image);
通知=新建NotificationCompat.Builder(arg0.getContext())
.setContentTitle(“我想…”)
.setContentText(文本)
.setContentIntent(待定)
.setSmallIcon(R.drawable.ic_启动器)
.setStyle(新通知Compat.BigPictureStyle()
.bigPicture(bmp))
.build();
notificationmanager=(notificationmanager)arg0.getContext().getSystemService(Context.NOTIFICATION\u服务);
notificationmanager.notify(notificationId,notification);
notificationId++;
返回null;
}
}.execute();
`

这正是我想要的。但我想在用户单击通知时显示*Text2*

*注意:*现在,当我单击此通知时,它会将我带到应用程序本身,这是预期的。但这现在应该只更改文本,而不会将我带到其他地方


请考虑重新编译我的代码,如果可能的话,

< P>你应该能够实现,通过实现一个“代码>广播收发器< /代码>作为一个点击侦听器,改变你的行为<代码> SungPosivs<代码>指向它,以及你的<代码>通知>代码>新的文本从<代码>广播接收器< /代码>回调。android应用程序开发新手。你能告诉我从哪里开始学习broadcastReceiver吗?并将你的操作挂起内容更改为指向它,你的意思是我应该将broadcastReceiver作为挂起的意图(我是指午餐的第二个意图)??@androCoder BD:您可以在中阅读关于
BroadcastReceiver
。是的,您应该使用
getBroadcast()
方法创建
PendingEvent
并提供
意图来启动
BroadcastReceiver
,而不是
活动。