Android app needs not to be wiped from memory

a 夏天 提交于 2019-12-02 15:05:34

问题


I want to develop an app which needs to be in memory until user clicks the force stop button in the task manager screen then only its broadcast receivers can trigger by particular event and i can do my works.

I have been searching for this solution a long time. A lot saying that's not possible. But i have seen that face book and class of clans applications always running and kept in memory even clearing all recent applications. Now someone help me how to do that? Thanks in advance!

Update: I used Services Which returns START_STICKY its not a good idea when lower memory devices.. and I used

 startForeground(id, notification);

still some devices clears the foreground service if i clear recent items...

watsapp and Facebook like applications using some ideas to do that without foreground notifications...In all of the devices clearing recent items doesnt affect the applications services like facebook and watsapp those applications services always running and I am keep receiving notifications from them!!

All I need is I want my receiver to run until I uninstall my app or go-to task manager and force closes it or android closes it under some low memory circumstances... Until that imy receiver has to go on .. that's it!

Hope you guys understand my pblm!!!

来源:https://stackoverflow.com/questions/41217819/android-app-needs-not-to-be-wiped-from-memory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!