腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(7687)
视频
沙龙
1
回答
使用
NotificationCompat
.
addAction
按钮
停止
前台
服务
android
、
android-notifications
、
foreground-service
如何
使用
前台
服务
在类中创建的通知
停止
前台
服务
?pIntent = PendingIntent.getService(this, 0, stopnotificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat
.BuildernotificationBuilder = new
NotificationCompat
.Builder(this, channelId)
浏览 37
提问于2020-01-24
得票数 2
回答已采纳
2
回答
如何在用户刷掉应用程序后继续播放背景音乐?
android
、
service
、
android-service
、
android-mediaplayer
在安卓系统中,我
使用
Service和MediaPlayer播放音乐。当我按“主页”
按钮
时,音乐会继续播放,但如果我“滑动”这个应用程序,音乐就会
停止
播放。
浏览 3
提问于2013-07-24
得票数 8
1
回答
我如何知道在通知中单击了哪个
按钮
?
android
、
android-notifications
主通知
按钮
运行
前台
服务
timer
按钮
运行
前台
服务
,但显示吐司消息<code>E 110</code>禁用
按钮
<code>E 211<//code>从状态栏<code>H 212</code><code>f 213</code>删除通知 是否有办法为所有三个
按钮
使用
一个
前台
浏览 0
提问于2021-08-11
得票数 2
回答已采纳
3
回答
如何从自身的
前台
通知
停止
服务
android
、
service
、
notifications
、
kill
在它的onStartCommand中,我
使用
startforeground来避免被系统杀死。this.ACTION_STOP_SERVICE); builder.
addAction
R.drawable.ic_launcher, "Stop", pStopSelf);} 但是
浏览 0
提问于2015-05-24
得票数 27
回答已采纳
1
回答
如何
使用
广播接收器
停止
前台
服务
android
、
broadcastreceiver
、
foreground-service
现在,我有一个
前台
服务
,它创建一个通知: intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOPnotificationBuilder = .setContentI
浏览 2
提问于2020-01-23
得票数 0
回答已采纳
1
回答
startForegroundService -无法
使用
setContentIntent +
addAction
?
android
、
android-intent
、
service
、
notifications
、
foreground
不幸的是,关于我的startForegroundService通知的另一个问题...我搜索了,真的,我搜索了: 我有一个运行良好的
前台
服务
。我想在此通知中添加一些操作。例如,当用户点击通知时,他们会被发送到MainActivity,并添加一个“退出”
addAction
。.setContentIntent(pendingIntent) startForeground(13365, notification);
使用
上面的通知可以很好地显示我也试过
使用
<e
浏览 33
提问于2020-09-28
得票数 0
1
回答
在活动处于
前台
时接收显式意图
android
、
android-intent
、
android-service
、
android-notifications
、
android-pendingintent
我的应用程序有一个activity和一个
服务
。该
服务
启动一个
前台
通知,该通知具有一个操作
按钮
,在某些情况下,该
按钮
需要通知活动执行某些操作,而不仅仅是返回到
前台
。它
使用
Extras来表示这一点。pendingActionIntent: PendingIntent = PendingIntent.getActivity(this, 0, actionIntent, 0) val actionCancel:
NotificationCompat
.
浏览 16
提问于2020-05-02
得票数 3
回答已采纳
1
回答
如何通过单击通知操作来调用
前台
服务
上的方法?
android
、
kotlin
、
android-notifications
我有
前台
服务
。它在后台执行一些异步工作,并定期发出通知,询问用户是否应该
停止
工作。下面的代码是我卡住的地方。eventReceiverHelper = EventReceiverHelper { stopAction() }
addAction
= PendingIntent.getBroadcast(this, 0, intent
浏览 6
提问于2022-08-13
得票数 0
回答已采纳
5
回答
允许在调用stopForeground(false)后取消通知
android
、
android-service
、
android-notifications
、
android-notification-bar
我有一个媒体
服务
,它在播放开始时
使用
startForeground()来显示通知。它在播放时有暂停/
停止
按钮
,暂停时播放/
停止
按钮
。
使用
相同的代码调用stopForeground(true);与预期的一样,但是当它被销毁和重新创建时,通知会闪烁。每当
服务
被播放或暂停时,都会调用createNotification。startForeground将强制应用程序在
前台
显示通知,并且应该只调用要显示的通知来调用该方法。我
浏览 6
提问于2013-03-25
得票数 21
回答已采纳
3
回答
NotificationManager.cancel()不起作用:未删除通知
android
、
android-service
、
foreground
、
android-notifications
、
notificationmanager
我一直在尝试
使用
以下命令删除
服务
设置的永久通知:我用来取消它的代码:nManager.cancelAll(); //surpluous, but also doesn't take effect 为了阐明我为什么要这样做:
服务
以默认的持久通知启动
使用
notify()对现有的通知完美的工
浏览 2
提问于2012-07-09
得票数 7
回答已采纳
1
回答
如何
使用
parse在android的通知中添加
按钮
android
、
push-notification
、
google-cloud-messaging
我们可以在android中
使用
parse发送推送通知时添加操作
按钮
吗?我知道如何
使用
android通知,但不知道如何
使用
parse来实现。
浏览 2
提问于2015-06-30
得票数 1
1
回答
在PendingIntent中执行函数
android
、
firebase
、
kotlin
、
google-cloud-firestore
:class.java) val action =
NotificationCompat
.Action(R.drawable.cancel, "Cancel", pendingIntent) val notif =
NotificationCompat
.Builder(this, channelIdContextCompat.getColor(this@MyService, R.co
浏览 15
提问于2019-09-27
得票数 0
1
回答
如何
使用
addAction
按钮
取消正在进行的
服务
android
、
notifications
如何
使用
.
addAction
实现待决意图的取消
服务
?
NotificationCompat
.BuilderR.drawable.i
浏览 0
提问于2018-02-19
得票数 1
2
回答
如何保持我的
前台
服务
通知(MediaStyle)在顶部像谷歌播放音乐?
android
、
android-notifications
、
foreground-service
它是
前台
,并
使用
MediaStyle与自定义操作(通知中的
按钮
),如prev,播放/暂停,下一步和关闭。也尝试
使用
MediaSession,并设置PRIORITY_MAX,但仍然没有运气。.setLargeIcon(icon) .setContentIntent(notificationPendi
浏览 3
提问于2019-08-21
得票数 3
回答已采纳
4
回答
在单击时隐藏来自
前台
服务
的通知通知操作
android
、
android-service
、
android-notifications
我有一个警报应用程序,它有一个带有平视通知
前台
服务
,通知有两个动作,其中一个向
服务
发送意图,并可以根据应用程序配置打开活动。 问题是,当我单击将意图发送到
服务
的操作时,通知不会隐藏。当意图打开活动时,似乎不会发生这种情况 我不想要没有通知的
前台
服务
,我只希望它在意图发送到
服务
时将其隐藏回通知抽屉 代码如下:
NotificationCompat
.Builder(mAlarmApplicationLongArray(0)) .se
浏览 5
提问于2018-03-02
得票数 13
1
回答
android -从最近的应用程序中删除的应用程序取消
前台
通知
android
、
android-service
、
android-notifications
我正在制作音乐播放器应用程序,我启动了音乐播放过程的
前台
服务
。但是当应用程序从最近的应用程序中删除时,
前台
通知被取消,音乐仍在播放!,这意味着
前台
服务
没有通知。我尝试过:在创建
NotificationCompat
.Builder增量时
使用
setAutoCancel(false)和setOnGoing(true),但两者都不起作用。); } } 清单中的
服务
: <service android:name=&
浏览 16
提问于2019-03-16
得票数 1
回答已采纳
1
回答
使来自
前台
服务
的通知可在
服务
不再位于
前台
时取消。
android
、
service
、
notifications
、
foreground-service
我有一个音乐控制通知,允许用户启动/
停止
音乐。我想要与Google Play Music应用程序通知完全相同的行为:当音乐播放时,
服务
在
前台
,通知不可取消,当音乐不播放时,
服务
不再在
前台
,通知可以删除。它可以正常工作,但是当我取消
服务
的
前台
时,通知会很快被删除,然后才会重新出现。下面是我的代码,首先是如何构建通知: new androi
浏览 1
提问于2017-04-24
得票数 4
回答已采纳
1
回答
我正试着在
服务
器上每30分钟更新一次android的位置
android
、
service
、
location
我正在尝试发送
服务
器中的用户位置。快速获取位置并保存在RoomDatabase中,并从RoomDatabase中获取数据发送到
服务
器。但是当应用程序在后台时,我不能每30分钟获得一次位置。builder = new
NotificationCompat
.Builder(mContext, mContext.getString(R.string.app_name))mLocation.getLatitude(), mLocation.getLongitude()))
浏览 11
提问于2020-05-08
得票数 0
1
回答
Android
前台
服务
通知延迟
java
、
android
我有一个计时器
服务
,如果应用程序/活动不再在
前台
,就需要运行它。(serviceIntent); 65, notificationInte
浏览 10
提问于2022-07-22
得票数 1
回答已采纳
2
回答
startForeground()总是在三星8.0设备上显示弹出
android
、
android-notifications
、
android-8.0-oreo
每当我在
前台
服务
中
使用
startForeground()在通知中更新状态时,我都会遇到三星Galaxy显示弹出通知的问题。因此,问题是,如何在三星8.0+设备上悄悄地更新
前台
服务
通知?val notification =
NotificationCompat
.Builder(this, MY_NOTIFICATION_CHANNEL)
浏览 1
提问于2018-07-26
得票数 8
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
构建永不停止运行的Android服务
WhatsApp将支持暂停发送语音消息 稍后再继续录制
请勿在没有透彻理解的情况下使用前台窗口
想灵活控制系统升级,需要这样调教Windows10更新设置
自建网盘教程之:Zdir 国人开发的目录列表程序,无需数据库
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券