I've got a problem. I want to write a code, that user can rename some TextView in Activity and save it. So, when he close the app, and open it again, there must be TextView with his text.
I hope you understand my problem. Thank you for your help.
For example, when user open an app, he can see: user1, user2, user3, etc..then he's got option, rename. Then he put new value in edit_text and click button, so when he close the app and open it again, he see John, Peter, user3, etc.
The best way to do this is using SharedPreferences and storing your string or whatever you choose to use to represent your string. As Mina says, you can save the value in onPause or onStop, and pull it in onCreate so you can populate the TextView.
I download this example, but I get an error:
"The method onClick(View) of type new View.OnClickListener(){} must override a superclass method". I deleted @override before onClick (View arg0) and error has gone, but program crashed.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.