【问题标题】:Can I create test using java in android studio as we create tag在我们创建标签时,我可以在 android studio 中使用 java 创建测试吗
【发布时间】:2021-07-06 17:54:05
【问题描述】:

enter image description here

我遇到通知错误,任何帮助解决它

【问题讨论】:

    标签: java android android-studio tags


    【解决方案1】:

    您需要编写以下代码来修复红色下划线:

    Intent notificationIntent = new Intent (MainActivity.this,NotificationView.class);
    

    对于下一个,您需要像这样设置getApplicationContext() 而不是this

    PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(),0,notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT);
    

    【讨论】:

      猜你喜欢
      • 2018-11-27
      • 2015-10-18
      • 2019-08-07
      • 2014-11-22
      • 1970-01-01
      • 2015-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多