【问题标题】:Refreshing adapter on pulling ListView in android在android中拉ListView时刷新适配器
【发布时间】:2012-10-19 12:15:05
【问题描述】:

如何应用下拉 ListView 并释放它的效果,它会刷新。 和 Facebook 一样,下拉它会刷新 NewsFeeds。

【问题讨论】:

    标签: android android-layout listview pull-to-refresh


    【解决方案1】:

    你可以使用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();
    }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-28
      • 1970-01-01
      • 2014-04-27
      • 2016-01-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多