Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android推送通知-不可移动推送通知,直到满足条件_Java_Android_Android Activity_Push Notification - Fatal编程技术网

Java Android推送通知-不可移动推送通知,直到满足条件

Java Android推送通知-不可移动推送通知,直到满足条件,java,android,android-activity,push-notification,Java,Android,Android Activity,Push Notification,我想在Android上做一个本地推送通知,它不能通过简单的向右滑动来删除。应事先满足应用程序中的条件。这可能吗?如果可能,我该怎么做?是的,你可以这样做 使用标志\u正在进行的\u事件 或 使用标志\u否\u清除 Notification notification = new Notification(icon, tickerText, when); notification.flags = Notification.FLAG_ONGOING_EVENT;

我想在Android上做一个本地推送通知,它不能通过简单的向右滑动来删除。应事先满足应用程序中的条件。这可能吗?如果可能,我该怎么做?

是的,你可以这样做

使用标志\u正在进行的\u事件

使用标志\u否\u清除

 Notification notification = new Notification(icon, tickerText, when);
        notification.flags = Notification.FLAG_ONGOING_EVENT;