andryr
andryr

Reputation: 684

Prevent application fom being killed without using a Service

My application is a Launcher. I want it to not being killed when the user leave the home screen (because when it get killed I have to reload all app icons and it takes a long time) but i don't want to use a Service. AOSP Launchers 1, 2, and 3 do it and they don't use any Service to do it.

What I tried is to copy the AndroidManifest.xml of these Launchers :

  <activity
        android:name=".Launcher"
        android:launchMode="singleTask"
        android:stateNotNeeded="true"
        android:clearTaskOnLaunch="true"
        android:windowSoftInputMode="adjustPan"
        android:theme="@style/Theme.Launcher" >

But it doesn't change anything for me.

Any ideas ?

Thanks

Upvotes: 0

Views: 161

Answers (2)

QArea
QArea

Reputation: 4981

Actually you can save all data in database. As for images you can save them on sdcard.

When user restarts your app - only after that you load all information. In this case any information will not be lost and the app will start very fast.

Upvotes: 0

ben75
ben75

Reputation: 28726

You can't do that : (reference)

The Android system attempts to keep application process around for as long as possible, but eventually will need to remove old processes when memory runs low

Upvotes: 2

Related Questions