[android-developers] Re: Files saved in internal memory getting cleared when application closed from multitask window
If you want your data to persist even when the Application is sent to background, it is better to save the data on the external SD Card. It might be that your data is getting cleared when you are swiping it off from the running Applications or recently running Applications. Try using SharedPreferences and see what happens. If that doesn't help, then it might be a good idea to use the External Directory or SQLite.
On Friday, July 5, 2013 8:15:06 AM UTC+1, Safy wrote:
Our app saves application data to internal memory using the Context.getDir(foldername,--Context.MODE_READABLE | Context.MODE_WRITABLE). The app data works fine on all platform except Android Samsung Galaxy Nexus 4.2.2 and Google Nexus 4.2.2, when the application is closed from the multi task window, by swiping the application out from current running application list. If the appllication is exited normally, by pressing back, back.. button the app data does not get affected.
We tried the same steps on HTC One 4.0.3, but the issue is not reproducible and the app data does not get cleared when the application is removed from currently running list from the multi task app running view. I have debugged a lot, I couldn't find any issue with the code. All the file streams are closed properly. Also when we set the following setting under developer option, Background process limit to No Background processes, the app data is not getting cleared on Samsung Galaxy Nexus 4.2.2 and Google Nexus 4.2.2.
If we set the Background process Limit back to Standard Limit and Close our application from Multi task application View on the device homescreen, the App data gets cleared, hence all the information of the user gets cleared.
Our application has multiple activities, When the Application is send to background by pressing Home Button from the Launcher Activity, and then closing the Application from Multi Tasking Window View, the App data does not cleared and the issue is not reproducible on Samsung Galaxy Nexus 4.2.2 and Google Nexus 4.2.2.
But when the Application moves away from Launcher Activity to other Activity of our Application and then our Application is sent to background, by pressing Home Button and then closing our application from Multi Tasking Window from the Device Homescreen, the Files saved using Context.getDir(foldername,Context.MODE_READABLE | Context.MODE_WRITABLE) is getting cleared.
I also tried to reproduce this issue on Android Emulator 4.2.2, but it is not reproducible and it is working perfectly.
I am not sure why the internal memory files are getting cleared by the OS and how is it related to the Limit Background Process, as our application is working perfectly with No Background processes, but it is getting cleared in case of Standard Limit which is the Factory Settings in all Devices.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home