Search in sources :

Example 1 with InitTokenTask

use of com.shizhefei.test.models.task.InitTokenTask in project MVCHelper by LuckyJayce.

the class PullrefshActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_pullrefsh);
    PullToRefreshListView refreshListView = (PullToRefreshListView) findViewById(R.id.pullToRefreshListView);
    mvcHelper = new MVCPullrefshHelper<>(refreshListView);
    // 设置数据源
    mvcHelper.setDataSource(DataSources.concatWith(new InitTokenTask(), new BooksDataSource()));
    // 设置适配器
    mvcHelper.setAdapter(new BooksAdapter(this));
    // 加载数据
    mvcHelper.refresh();
}
Also used : BooksAdapter(com.shizhefei.test.view.adapters.BooksAdapter) PullToRefreshListView(com.handmark.pulltorefresh.library.PullToRefreshListView) InitTokenTask(com.shizhefei.test.models.task.InitTokenTask) BooksDataSource(com.shizhefei.test.models.datasource.BooksDataSource)

Aggregations

PullToRefreshListView (com.handmark.pulltorefresh.library.PullToRefreshListView)1 BooksDataSource (com.shizhefei.test.models.datasource.BooksDataSource)1 InitTokenTask (com.shizhefei.test.models.task.InitTokenTask)1 BooksAdapter (com.shizhefei.test.view.adapters.BooksAdapter)1