After that, go to layout configuration and change your xml file as shown below (please click on picture to enlarge) :
After configuring our xml layout, next let's go to main activity. Put these code in it :
Yaaaaikzzz.... That's all of it... Let's run our project on real device :
After pressing "save" button, then close your application. Then open it again, now you'll see that your data is still there... This is the simple example of how to use sharedPreferences in android...
Thanks... :-)
No comments:
Post a Comment