Note that there are some explanatory texts on larger screens.

plurals
  1. POList view does not update at all
    primarykey
    data
    text
    <p>Hi i am using view pager indicator with three fragments and in one of the i have a list view that show the content of my SQLite Database but when a add data to my table the list view doesn't show he new data that i have added here is my code:</p> <pre><code>public class caleryhistory extends SherlockListFragment { List&lt;calery_lagari&gt; Calery_lagari; calery_lagari_SQLiteData data; ArrayAdapter&lt;calery_lagari&gt; adapter; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View v = inflater.inflate(R.layout.calery_history, null); data = new calery_lagari_SQLiteData(getActivity()); data.open(); Calery_lagari = data.findall(); adapter = new ArrayAdapter&lt;calery_lagari&gt;(getActivity(), R.layout.listback_layout, Calery_lagari); adapter.notifyDataSetChanged(); setListAdapter(adapter); adapter.notifyDataSetChanged(); return v; } </code></pre> <p>so any help? Thanks in advance! :)</p> <p><strong>Update</strong></p> <pre><code>import java.util.List; import mr.chag.va.lagar.R; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ListView; import com.actionbarsherlock.app.SherlockListFragment; public class caleryhistory extends SherlockListFragment { List&lt;calery_lagari&gt; Calery_lagari; calery_lagari_SQLiteData data; ArrayAdapter&lt;calery_lagari&gt; adapter; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View v = inflater.inflate(R.layout.calery_history, null); return v; } @Override public void onViewCreated(View view, Bundle savedInstanceState) { data = new calery_lagari_SQLiteData(getActivity()); data.open(); Calery_lagari = data.findall(); adapter = new ArrayAdapter&lt;calery_lagari&gt;(getActivity(), R.layout.listback_layout, Calery_lagari); adapter.notifyDataSetChanged(); ListView listView = (ListView)view.findViewById(android.R.id.list); listView.setAdapter(adapter); adapter.notifyDataSetChanged(); super.onViewCreated(view, savedInstanceState); } } </code></pre> <p>my layout </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;Button android:id="@+id/button1" android:layout_width="match_parent" android:layout_height="wrap_content" android:onClick="clear" android:text="clear all" /&gt; &lt;ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;/ListView&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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