0
私は配列リストからデータがロードされRecyclerViewを持っている:戻るボタンが第二の活動にタップするとonResume()の新しいデータでRecyclerViewをリフレッシュするには?私の主な活動で
protected void onReady(Bundle savedInstanceState) {
...
// create summary item array & populate it based on task item array
_alData = new ArrayList();
PopulateDataList();
_rv = (RecyclerView) findViewById(R.id.rvDataList);
_li = getLayoutInflater();
_rv.setLayoutManager(new LinearLayoutManager(this));
_adapter = new TaskItemAdapter();
_rv.setAdapter(_adapter);
...
}
、それは私の主な活動に返しますが、RecyclerViewではありません新しいデータで更新されました。だから私は、次の追加したい:
public void onResume() {
super.onResume(); // Always call the superclass method first
// clear out & re-populate summary list, in case something has changed
_alData.clear();
PopulateDataList();
// *** WHAT GOES HERE...???
}
私は再移植リストからデータを再バインドするRecyclerViewを伝える方法がわからない...任意の助けいただければ幸いです!
パーフェクト!それはかなり簡単でした。私はRecyclerViewでアダプタではなくいくつかのメソッドを探していました... –