相关疑难解决方法(0)

通知未关闭(Android)

如果单击“操作”,则通知setAutoCancel(true)不起作用

我有一个通知,其中包含操作。当我点击通知时,它将从列表中删除。但是,当我单击“操作”时,它成功完成了该操作(即拨打电话),但是当我返回到通知列表时,它仍然存在。AlarmReceiver的相对代码:

public class AlarmReceiver extends BroadcastReceiver {
Meeting meeting;

/**
 * Handle received notifications about meetings that are going to start
 */
@Override
public void onReceive(Context context, Intent intent) {

    // Get extras from the notification intent
    Bundle extras = intent.getExtras();
    this.meeting = extras.getParcelable("MeetingParcel");

    // build notification pending intent to go to the details page when click on the body of the notification
    Intent notificationIntent = new Intent(context, MeetingDetails.class);
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    notificationIntent.putExtra("MeetingParcel", meeting);      // send meeting that we received to …
Run Code Online (Sandbox Code Playgroud)

notifications android dismiss

5
推荐指数
1
解决办法
1305
查看次数

标签 统计

android ×1

dismiss ×1

notifications ×1