Dynamically created buttons have same label after restarting application?
问题 I'm using a predefined button to generate new buttons when click on it. After generating new buttons I wish to change their label for that I'm using EditText defined in dialog box which pops up onLongClick of new generated buttons. To store all the generated buttons and their label I'm using Shared preferences . But the problem is after restarting all the generated buttons have same label on them. code in mainactivity----- SharedPreferences prefs=null; String key; int btncount = 15; code in