Note that there are some explanatory texts on larger screens.

plurals
  1. POListView doesn't update on returning to the activity
    primarykey
    data
    text
    <p>I am working on one app and I have one list view in one screen in that i am passing values using class. On <code>listview</code>'s item click event it opens activity for selecting values. and i m saving this value to the <code>SharedPrefrence</code> as i wanted these data to the another activity. It stores value to the <code>SharedPreference</code>. But it doesnt update <code>listview</code> on returning to the activity. But I am getting updated List <code>onCreate()</code>.</p> <pre><code>try{ selectedParentMessage = ParentMessageListActivity.parentMsgSharedPref.getString("SelectedParentMessage", "None"); System.out.println("Selected Parent Message:"+selectedParentMessage); }catch (Exception e) { // TODO: handle exception e.printStackTrace(); } items.add(new Setting_ActivitySectionItem("Sounds")); //items.add(new Setting_ActivityEntryItem("Cartoon's Voice", "")); items.add(new Setting_ActivityEntryItem("Record Parent's Message", ""+selectedParentMessage)); items.add(new Setting_ActivityEntryItem("Import Lullaby", "")); items.add(new Setting_ActivitySectionItem("Alerts")); items.add(new Setting_ActivityEntryItem("Phone Number", "")); items.add(new Setting_ActivityEntryItem("Email Id", "")); items.add(new Setting_ActivityEntryItem("Send Notification", "")); //items.add(new EntryItem("Item 7", "This is item 2.4")); items.add(new Setting_ActivitySectionItem("Baby's Noise Level")); items.add(new Setting_ActivityEntryItem("High", "")); items.add(new Setting_ActivityEntryItem("Medium", "")); items.add(new Setting_ActivityEntryItem("Low", "")); //items.add(new EntryItem("Item 11", "This is item 3.4")); //items.add(new EntryItem("Item 12", "This is item 3.5")); items.add(new Setting_ActivitySectionItem("Set Auto-silent")); items.add(new Setting_ActivityEntryItem("Auto Silent", "")); items.add(new Setting_ActivitySectionItem("Set Battery reminder")); items.add(new Setting_ActivityEntryItem("Battery Reminder", "")); adapter = new Setting_ActivityEntryAdapter(this, items); adapter.notifyDataSetChanged(); setListAdapter(adapter); </code></pre> <p>and also i am applying <code>notifydatasetchange()</code> on <code>onResume</code> and <code>onRestart()</code></p> <pre><code>public void onRestart(){ super.onRestart(); System.out.println("onrestart"); try{ selectedParentMessage = ParentMessageListActivity.parentMsgSharedPref.getString("SelectedParentMessage", "None"); System.out.println("Selected Parent Message:"+selectedParentMessage); }catch (Exception e) { // TODO: handle exception e.printStackTrace(); } getListView().invalidateViews(); adapter.notifyDataSetChanged(); } </code></pre> <p>and same for <code>onPause()</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload