I am trying to implement SwipeListView using Pull-to-Refresh on a ListView . it is successfully integrated, but after it adds one element to the list. viewing the list is not refreshing. and no items are added to the list.
I have implemented SwipeListView from here and Pull to Refresh from here . how can i add multiple items to the list and update the list after adding the item. JAVA code
package com.eample.swipelistviewexample; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.content.res.TypedArray; import android.os.AsyncTask; import android.os.Bundle; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.util.DisplayMetrics; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.widget.AdapterView; import android.widget.AdapterView.OnItemLongClickListener; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.fortysevendeg.swipelistview.BaseSwipeListViewListener; import com.fortysevendeg.swipelistview.PullToRefreshBase; import com.fortysevendeg.swipelistview.PullToRefreshBase.OnRefreshListener; import com.fortysevendeg.swipelistview.PullToRefreshBase.OnRefreshListener2; import com.fortysevendeg.swipelistview.PullToRefreshSwipeListView; import com.fortysevendeg.swipelistview.SwipeListView; public class Contact extends Activity { public PullToRefreshSwipeListView ptorefreshList; public SwipeListView swipeListView; ProgressDialog dialog; private ArrayList<String> mItems; CategoryAdapter adapter; @SuppressWarnings("unchecked") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main); mItems = new ArrayList<String>(); for(int i=0;i<10;i++) mItems.add("Musethe place "+i); ptorefreshList=(PullToRefreshSwipeListView) findViewById(R.id.example_list); swipeListView = ptorefreshList.getRefreshableView(); adapter = new CategoryAdapter(Contact.this, mItems); } @Override protected void onResume() {
source share