fragment与active通讯

Activity与Fragment之间的传值问题

Activity传值给Fragment

添加Fragment的Activity:

https://blog.csdn.net/xingchenhy/article/details/81356400

 方法2

/**
* 想给fragment传id
*
* @return .
*/
public InvoicePhotoEditAllBean getDateId() {
InvoicePhotoEditAllBean bean = new InvoicePhotoEditAllBean();
bean.setStype(mStypes);
bean.setInvoiceId(mInvoiceId);
bean.setContractId(mContractId);
return bean;
}
/*上一页面接受值*/
mStypes = ((InvoicePhotoEditAllActivity) Objects.requireNonNull(getActivity())).getDateId().getStype();

 

 

posted on 2021-06-10 10:05  带镐伤的土豆  阅读(76)  评论(0编辑  收藏  举报

导航