【问题标题】:Firebase: Set text on textview after processing other activityFirebase:在处理其他活动后在 textview 上设置文本
【发布时间】:2017-09-06 05:19:25
【问题描述】:

各位朋友,我正在使用 FCM 推送通知,我想在活动中显示通知正文。但为此我希望当我点击通知时, 1)首先它将带我到包含“显示消息”按钮的活动,然后 2)通过单击该按钮,我将被重定向到将显示通知正文消息的活动

这是什么方法,求大神帮忙!谢谢

【问题讨论】:

    标签: android firebase firebase-realtime-database push-notification firebase-cloud-messaging


    【解决方案1】:

    只需在通知中使用关注

    Intent intent = new Intent(this, AcitivityWhereyouWantToGo.class);
    intent.putExtra("STRING_I_NEED", strName);
    //System.currentTimeMillis() is used for unique Id
    PendingIntent contentIntent = PendingIntent.getActivity(this, (int) System.currentTimeMillis(), intent,0);
    

    现在得到boday的值

    Bundle extras = getIntent().getExtras();
    newString= extras.getString("STRING_I_NEED");
    

    将此字符串设置为您要显示的文本视图

    【讨论】:

      猜你喜欢
      • 2019-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多