-1

I Know If the User have to Store UserName and Password then we can create Class and store the UserName and Password in Class. At get the data using SharedPreferences for that class.But That class store the data upto we can not close the Application. If we close the Application then data will be destroyed.

My Question is :

I Want to Store Data in Application if the User close the application or Restart the Mobile device. But the data are Store in the Class. How to perform this task. I am new to android. Please Help me.

Harshad
  • 1,256
  • 1
  • 9
  • 25

1 Answers1

0

You are new to Android. So, you should go through this link. You got these many Storage options in Android: http://developer.android.com/guide/topics/data/data-storage.html

In your case, You can go with SharedPreferences. Your data will be stored in key-value pair. And also, it is persistent storage.

Chintan Soni
  • 22,543
  • 24
  • 96
  • 158