腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
为什么
每次
服务
处理
新
意图
时
都会
调用
IntentService
的
onStartCommand
方法
android
、
android-pendingintent
、
intentservice
、
location-updates
我有一个
服务
,接收位置更新每1-3秒左右。使用挂起
的
意图
从主活动启动
服务
: mFusedLocationClientFast.requestLocationUpdates(mLocationRequest, getPendingIntent()); 其中,getPendingIntent()是定义
IntentService
在handleIntent()中
处理
的
操作
的
方法
然而,我注意到一件奇怪
的
事情,
浏览 34
提问于2019-12-24
得票数 0
1
回答
Android:理解使用一个
IntentService
进行多个操作
android
、
intentservice
如果活动流是Home -> B -> C-> CF1 -> CF2,那么onHandleIntent在startService(
意图
)之后从CF2
调用
。B和CF1
意图
被
处理
。为了进行调试,我尝试等待
IntentService
在活动B中完成,然后转到CF1 -> CF2,仍然是相同
的
问题。在启动相同
的
意图
服务
方面,CF1似乎从未遇到过任何问题。当我尝试为
IntentService
创建一个<
浏览 4
提问于2013-02-17
得票数 3
回答已采纳
5
回答
如果Android
服务
多次启动,会发生什么情况?
android
0;i<filesArray.length;i++){ } 在这段代码中,DownloadService扩展了
IntentService
所以现在当我
调用
startService(intent)
时
,这是不是意味着
每次
调用
startService(intent)
都会
启动一个
新
服务
,或者这意味着DownloadService只运行一次,然后
每次
我
浏览 0
提问于2011-11-05
得票数 127
回答已采纳
1
回答
如何在
IntentService
上对多个
意图
进行排队
android
、
service
、
intentservice
对于
IntentService
的
使用,我有点困惑。 我非常确信,在系统
调用
onStartCommand
()
的
文档中,我只读过一次,如果您发出两次startService(),
浏览 0
提问于2013-02-12
得票数 15
回答已采纳
2
回答
如何在多个
IntentService
正在运行时停止一个
IntentService
android
、
service
、
download
、
intentservice
我有一个包含许多歌曲
的
列表视图。
每次
单击一首歌曲
时
,我
都会
调用
一个
IntentService
来按顺序下载这首歌曲。有人能告诉我阻止
IntentService
的
好
方法
吗?非常感谢你
的
帮助。
浏览 0
提问于2013-03-21
得票数 4
回答已采纳
1
回答
不
调用
onHandleIntent()
方法
java
、
android
、
android-service
、
intentservice
经过几个小时
的
研究,我终于咨询了官方
的
帮助。
为什么
不
调用
onHandleIntent()?这里有什么问题吗?
调用
onStartCommand
(),但不
调用
onHandleIntent()import android.content.Intent; pub
浏览 0
提问于2013-04-02
得票数 6
回答已采纳
3
回答
onHandleIntent与
onStartCommand
的
不同之处
android
、
android-service
、
intentservice
我目前正在编写一个安卓程序,这需要一个
IntentService
。当我将代码放在onHandleIntent函数中
时
,代码不会运行,但它不会在MainActivity中给出错误。但是,当我将代码复制到
onStartCommand
中
时
,它可以完美地运行。 问题是我想知道onHandleIntent和
onStartCommand
之间
的
区别。谢谢。
浏览 0
提问于2016-01-07
得票数 15
回答已采纳
1
回答
服务
和
IntentService
有什么区别?
android
什么时候使用
服务
,什么时候在应用程序开发过程中使用IntentServices。
浏览 4
提问于2016-03-31
得票数 0
2
回答
如何在运行
服务
的
同时停止
服务
?
android
、
service
、
android-asynctask
在我
的
应用程序中,我使用以下代码在后台运行
服务
。Service myser=new Intent(EmailRegistrationActivity.this, BackgroundService.class);在我
的
服务
类中在AsyncTask类中,我必须从设备获取短信和彩信,并在此过程之间发送到我本地server.In,用户想要在注销
方法
中登录out.So,我想要停止
服务
。checkmessages
方法
从设备获取数据,并将
浏览 1
提问于2014-08-07
得票数 0
1
回答
Android
服务
被破坏,但不是无限循环
android
、
bluetooth
、
xamarin
、
intentservice
我
的
应用程序(Xamarin.Android)出现问题。我正在尝试编写应该扫描蓝牙设备
的
服务
:internal class BluetoothService :
IntentService
...(Intent intent) // Thats not working... public override StartCommandResult
OnStartCommand
和ScanLeDeviceInL
浏览 2
提问于2014-07-31
得票数 0
3
回答
在多个活动上启动
服务
,同时传递每个活动
的
数据
android
我想创建这个
服务
来
处理
多个活动。我
的
意思是,每个活动都可以向该
服务
发送数据,并从中获取数据。
浏览 0
提问于2015-11-18
得票数 3
2
回答
当将
意图
额外
的
子字符串传递给Service类
时
,将对其进行更改
android
、
android-intent
JSON {"latitude":53.86907815,"longitude":10.66554789,"formatted":"23.04.2015 10:16:49","route":4}传递给
服务
类"PostData“,但是在
onStartCommand
()
方法
中获得null和JSON字符串
时
,格式化
的
值总是旧值,而不是传递给类的当前值。MainActivity内部类中
的
浏览 1
提问于2015-04-24
得票数 0
回答已采纳
1
回答
基于SignalR
的
安卓推送通知
的
意向
服务
android-service
、
intentservice
我正在使用SignalR向我
的
安卓客户端发送通知。为此,我使用
意图
服务
。问题是,当我从最近
的
应用中删除应用程序时,该
服务
就会被停止。之所以会发生这种情况,是因为
IntentService
并不总是在运行,但它是在
意图
基础上工作
的
。 基本上,我想知道是否应该使用常规
服务
来不断地接收通知,或者是否有其他
方法
来保持意向
服务
的
活力。
浏览 4
提问于2017-02-01
得票数 2
回答已采纳
2
回答
服务
在应用程序关闭
时
停止
java
、
android
、
service
我正在开发一个壁纸应用程序,其中我正在设置一个壁纸上
的
图像画廊与洗牌效果为5分钟,10分钟等。我正在使用此任务
的
服务
。当应用程序保持在后台
时
,我
的
服务
工作得很好,但当应用程序get stopped.This是我
的
服务
类代码
时
,
服务
会停止: // notification BAR mHan
浏览 2
提问于2018-07-05
得票数 0
3
回答
在应用程序通过任务管理器关闭
时
停止重新启动android
服务
android
我使用
的
是一个
服务
,每当
服务
器中有
新
的
更新
时
,它就会更新我
的
应用程序。因此,我
的
服务
运行,它总是检查
服务
器
的
版本更新,如果我得到
新
的
版本更新,它将安装。我
的
问题,每当我关闭我
的
申请表taskmanager,我
的
服务
就会被淘汰。我在
onstartcommand
()中也使用了<e
浏览 2
提问于2015-01-27
得票数 0
回答已采纳
4
回答
IntentService
中
的
循环
android
、
android-intent
、
intentservice
我
的
IntentService
中有一个无限循环,它根据主活动
的
输入每30秒更新一次视图。public class IntentServiceTest extends
IntentService
{ String ACTION_RCV_MESSAGE即使我终止了主活动,然后返回到它输入
新
的
输入,
IntentService
仍然根据旧
的
输入返回。 我需要知道如何才能每隔
浏览 2
提问于2012-08-18
得票数 7
1
回答
如果挂起
意图
调用
getService()多次启动一个活动
的
后台
服务
,该怎么办?
android
如果PendingIntent多次
调用
getService()来启动后台
服务
(这是活动
的
),该怎么办?我
的
猜测是,除了
onStartCommand
(
意图
、int标志、int startId)之外,后台
服务
仍将被多次
调用
,对吗?在我
的
例子中,我试图
调用
requestActivityUpdates()来检测用户
的
活动(移动,仍然,.)。当有检测到
的
活动(回调函数被
调用
浏览 1
提问于2016-08-10
得票数 0
回答已采纳
1
回答
Android:在
服务
中从intent检索额外
的
内容?
java
、
android
、
android-intent
因此,我正在启动一个带有要传递
的
putExtra整数值
的
服务
: context.startService(i);int result
浏览 0
提问于2011-06-13
得票数 1
回答已采纳
4
回答
如果我关闭应用程序,
服务
将关闭。
android
、
intentservice
我从应用程序类
调用
服务
,如果我关闭该应用程序或从当前运行
的
应用程序中删除,则该
服务
将自动销毁,我没有在code ()
方法
中编写任何代码。这里
调用
服务
的
代码是: this.startService(syncIntent);public class ScanBLE_Servic
浏览 4
提问于2016-06-29
得票数 0
回答已采纳
2
回答
Android -多次运行
IntentService
android
、
android-intent
、
android-intentservice
所以我有一个
IntentService
,当我运行它一次
时
,它运行得很好。它需要图像操作,然后输出一系列RGB值。有正确
的
方法
吗?
浏览 2
提问于2016-01-13
得票数 5
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
Service初涉
Servlet生命周期
Tensorflow 估算器的加速站,你舍得错过吗?
揭秘 RocketMQ 新特性以及在金融场景下的实践
如何增强rasa nlu 模型,也许你不知道的方法
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券