ListView Item Click Open Custom Dialog With Another Custom Listview
Here I have created custom dialog which includes listview with single choice mode. when user selects one of the item in listview then it should be selected when dialog is opened ne
Solution 1:
For simply saving a value to persist app sessions you can use the SharedPreferences
API:
Here's a sample of saving:
SharedPreferences settings = getSharedPreferences("MYPREFS", 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean("isChecked", rb.isChecked());
editor.commit();
where rb
is your radioButton. and to retrieve it and apply it next time, you can use:
SharedPreferences settings = getSharedPreferences("MYPREFS", 0);
rb.setChecked(settings.getBoolean("isChecked", false));
Note that false
here is simply a default value in case a value with that key doesn't exist the sharedPrefs file yet. It will automatically create one if not existing.
Post a Comment for "ListView Item Click Open Custom Dialog With Another Custom Listview"