notificationmanager

    -3热度

    1回答

    我想删除位于状态栏上的通知。我使用Notification Manager.cancel(),但它不起作用。我用cancelAll()也得到了相同的结果。 我的代码是: public class NotificationListenerService extends android.service.notification.NotificationListenerService { ...

    0热度

    1回答

    一旦下载了应用程序,我会向用户显示通知。 我也有一个安装下载的应用程序的installApk方法,但在代码片(completeNotification)中,应用程序自动安装。我需要它仅在用户标签通知时才安装。 我忽略了什么吗? 谢谢你的帮助。 的completeNotification方法: public void completeNotification() { Intent ins

    0热度

    1回答

    package com.example.khatrimann.notification; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import and

    0热度

    1回答

    我遇到以下问题。 当一个文件被下载时,我会向用户显示一个通知,当他/她选择通知时,它会搜索适用的应用程序(例如PDF阅读器)以打开文件。 Eveything在我选中通知但是没有安装PDF阅读器时工作没有烤面包信息显示给用户。 有人可以帮助我吗?我知道try块是空的,因为我不知道到底是什么来调用toast消息。 谢谢。 编辑:它的工作原理当我取消注释“context.startActivity(目标

    1热度

    1回答

    我试图在用户单击按钮时的特定时间设置通知。 像这样: // make this duration fifteen minutes before startTime long futureInMillis = SystemClock.elapsedRealtime() + Long.parseLong(holder.handlerGapTV.getText().toString(

    0热度

    1回答

    我正在项目中,我们正在显示每个相册更新的通知。但是在点击一个通知后,它会从通知栏中删除所有通知。 我尝试下面的代码: private void handleNotification(NotificationModel notificationModel) { // display the notification in the notification bar int i=0;

    1热度

    1回答

    上午每隔15分钟目前正在建设使用广播接收器Android应用程序触发,这是一个WifiDetection应用程序,它可以扫描一个独特的SSID,我的通知工作正常,但始终触发每1秒(这是恼人的),我希望延迟15分钟或30分钟。这里是我的一些代码。 我已经使用Thread.sleep()方法和处理程序,但它减缓和崩溃我的应用程序 public class WifiReceiver extends Br

    1热度

    1回答

    这是设置和删除通知的代码。如果您需要更多详细信息,请告诉我。堆栈溢出的唯一解决方案是关于等待的意图是相同的。我已经尝试过这个解决方案,但没有奏效。 public void setAlarm() throws java.text.ParseException { RealmResults<Reminder> realmResults = getAllLatest(); Alar

    0热度

    1回答

    BroadcastReceiver中的变量不会在每次设置通知/警报管理器时更新。 “接收器(循环器)” 是从一个片段。 接收器”是从一个BroadcastReceiver类。 onCreateView intentAlarmManager = new Intent(context, NotificationReceiver.class); pendingIntent = PendingInten

    1热度

    2回答

    每次我设置警报/通知。通知生成器立即触发,我不知道如何设置“延迟”以匹配警报管理器。 虽然它的工作'正常'。它在闹钟管理员设置好的时候弹出。 的onReceive(),用于设置告警 public void setAlarm(Context context, int hour, int min, int notifyID) { Calendar calendar = Calendar.ge