I have a settings menu in my application. When I click Menu button, I can click on settings icon and setting activity appears. Settings layout contains a listview, each list view item consists of textview (description of setting) and edittext (setting data). I store the data in settings table in SQLite database and add all of the settings to an adapter (ListAdapter) and listView like this:
Cursor cursor = dbAdapter.fetchSettings();
startManagingCursor(cursor);
String[] from = new String[] { "description", "data" };
int[] to = new int[] { R.id.settingsDesc, R.id.settingsText };
listAdapter = new SimpleCursorAdapter(this,
R.layout.settings_menu_item, cursor, from, to);
listView.setAdapter(listAdapter);
As you see I can change the setting data. My question is, how can I update the database when I have changed the text in any of the edittext elements? I also have Save button in Settings layout and I want that clicking on it would update the database. I hope there is a simple way to do it.