keeping background service alive after user exit app
2015-12-11 14:47
537 查看
http://stackoverflow.com/questions/17767767/keeping-background-service-alive-after-user-exit-app?rq=1
I'm trying to create some service that will do background jobs for me even after the user closed the app from the running processes menu(by shifting process up the screen). I'm not sure if it even possible, so maybe this question is irrelevant.
What I tried to do is create service in a different process by declaring it like this:
and the onStartCommand() is:
I hope I provided enough info.
I'm trying to create some service that will do background jobs for me even after the user closed the app from the running processes menu(by shifting process up the screen). I'm not sure if it even possible, so maybe this question is irrelevant.
What I tried to do is create service in a different process by declaring it like this:
<service android:name=".service.Service" android:enabled="true" android:icon="@drawable/ic_launcher" android:process=":my_process" > </service>
and the onStartCommand() is:
@Override public int onStartCommand(Intent intent, int flags, int startId) { return START_STICKY; }
I hope I provided enough info.
相关文章推荐
- 【Android】设备工具类(DeviceUtil.java)
- android学习路线:如何成长为高级工程师
- Android TextInputLayout
- Upload large file in background (service restarting when the app closed)
- Android 多渠道打包原理和使用
- ERROR: Application requires API version 19. Device API version is 17 (Android 4.2.2).
- IOS-自动布局和视图化语言1
- swift -pop的简单动画
- Hbuilder开发HTML5 APP之创建子页面
- Android实现手机拍照功能
- No qualifying bean of type [com.shyy.web.service.TreeMapper] found for dependency
- Objective-C instancetype关键字
- typedef void (^ SuccesBlock)(id object);
- iOS平滑的下拉加载更多数据
- iOS微信安装包瘦身
- Swift 吐槽下Swift里一个逼死强迫症的语法:中缀语法
- Android-Androidstudio的快捷键
- Android判断屏幕锁屏的方法总结
- android4.4系统源码编译(四)_问题总结
- Appium常见问题(持续更新)