Avoid from being killed
来源:互联网 发布:java改string编码 编辑:程序博客网 时间:2024/06/15 19:56
Foreground process
A process that is required for what the user is currently doing. A process is considered to be in the foreground if any of the following conditions are true:
It hosts an Activity that the user is interacting with (the Activity's onResume() method has been called).
It hosts a Service that's bound to the activity that the user is interacting with.
It hosts a Service that's running "in the foreground"—the service has called startForeground().
It hosts a Service that's executing one of its lifecycle callbacks (onCreate(), onStart(), oronDestroy()).
It hosts a BroadcastReceiver that's executing its onReceive() method.
Generally, only a few foreground processes exist at any given time. They are killed only as a last resort—if memory is so low that they cannot all continue to run. Generally, at that point, the device has reached a memory paging state, so killing some foreground processes is required to keep the user interface responsive.
http://stackoverflow.com/questions/2785843/how-can-i-prevent-my-android-app-service-from-being-killed-from-a-task-manager
You can write a helper app to receive android broadcast"android.intent.action.PACKAGE_RESTARTED",when your app got killed,your helper will receive that broadcast and you can restart your app or whatever.
That's how 'Smart App Protector Free' do.
The bad thing is users must install two apps instead of one.
A process that is required for what the user is currently doing. A process is considered to be in the foreground if any of the following conditions are true:
It hosts an Activity that the user is interacting with (the Activity's onResume() method has been called).
It hosts a Service that's bound to the activity that the user is interacting with.
It hosts a Service that's running "in the foreground"—the service has called startForeground().
It hosts a Service that's executing one of its lifecycle callbacks (onCreate(), onStart(), oronDestroy()).
It hosts a BroadcastReceiver that's executing its onReceive() method.
Generally, only a few foreground processes exist at any given time. They are killed only as a last resort—if memory is so low that they cannot all continue to run. Generally, at that point, the device has reached a memory paging state, so killing some foreground processes is required to keep the user interface responsive.
http://stackoverflow.com/questions/2785843/how-can-i-prevent-my-android-app-service-from-being-killed-from-a-task-manager
You can write a helper app to receive android broadcast"android.intent.action.PACKAGE_RESTARTED",when your app got killed,your helper will receive that broadcast and you can restart your app or whatever.
That's how 'Smart App Protector Free' do.
The bad thing is users must install two apps instead of one.
0 0
- Avoid from being killed
- Avoid being Phished
- Protect Flash Files from Being Downloaded
- Tips to avoid being Rate Limited (避免速率限制的点子)
- Avoid Permgen Space error when running tomcat from eclipse
- things i learned from failing that you can avoid
- Lessons From A Lifetime Of Being A Programmer
- WF-mails not being sent from workflow mailer
- JAXB 2.0 API is being loaded from the bootstrap classloader
- How to avoid traps and correctly override methods from java.lang.Object
- How to avoid traps and correctly override methods from java.lang.Object
- java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader...
- java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader
- Is-there-any-way-to-prevent-an-android-app-from-being-removed
- JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI ...解决
- JAXB 2.1 API is being loaded from the bootstrap classloader各种解决方案
- 异常——JAXB 2.0 API is being loaded from the bootstrap classloader
- java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI ***
- java Map集合嵌套,value为Map和value为List
- android相关文章
- abstract class和interface有什么区别?
- Linq Join and GroupJoin.
- android安全问题,抢先开机启动
- Avoid from being killed
- 代码中读取android控制台Log(通过Logcat读取)
- CSDN貌似越来越强大啊
- 在ios中使用FMDB
- Search a 2D Matrix
- 测试使用zookeeper的c客户端的情况
- 1602自定义字模方法 CGRAM
- 反编译步骤(Smali方式)
- 关于基本类型的简单赋值运算和复合赋值运算