码迷,mamicode.com
首页 > 其他好文 > 详细

MainActivity 调用实现

时间:2019-08-04 19:38:03      阅读:92      评论:0      收藏:0      [点我收藏+]

标签:rri   bsp   nload   scroll   load   fresh   onscroll   com   ppc   


public class MainActivity extends AppCompatActivity{

RecyclerView mRecyclerView;
RecyclerAdapter mAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mRecyclerView =findViewById(R.id.recyclelist);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.setAdapter(mAdapter =new RecyclerAdapter(this, data.getDataList()));
mRecyclerView.addOnScrollListener(new UpPullRecyclerViewOnScrollListener(onScrollListener));
}

private UpPullOnScrollListener onScrollListener = new UpPullOnScrollListener() {
@Override
public void onLoadMoreData(http://www.amjmh.com/v/) {
Toast.makeText(MainActivity.this, "上拉更新了 ", Toast.LENGTH_SHORT).show();
}

@Override
public void onRefreshData() {
Toast.makeText(MainActivity.this, "下拉刷新了 ", Toast.LENGTH_SHORT).show();
}
};
}
--------------------- 

MainActivity 调用实现

标签:rri   bsp   nload   scroll   load   fresh   onscroll   com   ppc   

原文地址:https://www.cnblogs.com/liyanyan665/p/11299176.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!