如何应用下拉ListView的效果,释放时会刷新。 和Facebook一样,下拉时会刷新NewsFeeds。
最佳答案
您可以使用 this用于在 android 中创建此类列表。
您必须在代码中使用刷新监听器:
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();
}
});
关于android - 在 android 中拉取 ListView 时刷新适配器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12974112/