4

How to apply effect of pulling down ListView and on releasing it, it will do refresh. same as Facebook, when pulling down it, it will refresh the NewsFeeds.

Michael Celey
  • 12,645
  • 6
  • 57
  • 62
Rahul Upadhyay
  • 3,493
  • 2
  • 21
  • 37

1 Answers1

2

You can use this for creating such list in android.

You have to use the refresh listener in the code as:

   PullToRefreshListView listView = (PullToRefreshListView) findViewById(R.id.pull_to_refresh_listview);
   listView.setOnRefreshListener(new OnRefreshListener() {


public void onRefresh() {
    // Your code to refresh the list contents

    // ...

    // Make sure you call listView.onRefreshComplete()
    // when the loading is done. This can be done from here or any
    // other place, like on a broadcast receive from your loading
    // service or the onPostExecute of your AsyncTask.

    listView.onRefreshComplete();
}
});
AppMobiGurmeet
  • 719
  • 3
  • 6