Closed zhuoCreator closed 5 years ago
A,B页面的代码:AssetSerializableListBean serializableListBean = new AssetSerializableListBean(); serializableListBean.setList(assetDataList.getList()); LiveEventBus.get("asset_coin_list",AssetSerializableListBean.class).post(serializableListBean); ChangeActivity(InsertCoinActivity.class, false);
C页面的代码: LiveEventBus.get("asset_coin_list", AssetSerializableListBean.class).observeSticky(this, (@Nullable AssetSerializableListBean assetSerializableListBean) -> { if (assetSerializableListBean != null) { List list = assetSerializableListBean.getList();
List<AssetListBean.DataBean.ListBean> collect = Stream.of(list).filter(a -> a.isIsrecharge() == true).collect(Collectors.toList()); mList.addAll(collect); } });
A是fragment,B,C是activity ,我用eventbus 这样是可以用的
A,B页面的代码:AssetSerializableListBean serializableListBean = new AssetSerializableListBean(); serializableListBean.setList(assetDataList.getList()); LiveEventBus.get("asset_coin_list",AssetSerializableListBean.class).post(serializableListBean); ChangeActivity(InsertCoinActivity.class, false);
C页面的代码: LiveEventBus.get("asset_coin_list", AssetSerializableListBean.class).observeSticky(this, (@Nullable AssetSerializableListBean assetSerializableListBean) -> { if (assetSerializableListBean != null) { List list = assetSerializableListBean.getList();