Adapter update when pulling ListView in Android

How to apply the ListView distraction effect and free it, it will be updated. same as Facebook, when it resets it, it will update NewsFeeds.

+4
source share
2 answers

Follow this link. He has a working demo or pull to view the list of updates:

Pull to refresh demo

View the displayed list

+2
source

You can use this to create such a list in android.

You should use the update listener in code like:

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(); } }); 
+2
source

Source: https://habr.com/ru/post/1440769/


All Articles