我在下面有构造函数FragmentA:
public class FragmentA extends Fragment{
public static FragmentA newInstance(WebServiceResponse downloadedData) {
FragmentA fragmenta = new FragmentA();
Bundle bundle = new Bundle();
bundle.putSerializable("MyClass", downloadedData);
fragmenta.setArguments(bundle);
return fragmenta;
}
}
当我从DB检索数据时,我尝试使用以下代码将数据对象发送到FragmentA:
FragmentA object;
myObject = retriveDataFromDB(id);
object = FragmentA.newInstance(myObject);
this.getSupportFragmentManager().beginTransaction().replace(R.id.frmContainer,object).commit();
FragmentA有一个customView,并且内部的customView getArguments无法识别。我该怎么办?