无法识别customView中的getArguments函数

时间:2016-05-01 14:58:58

标签: android fragment custom-view

我在下面有构造函数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无法识别。我该怎么办?

0 个答案:

没有答案