Android fragments 将对象传递给片段

Android fragments 将对象传递给片段,android-fragments,Android Fragments,我试图将ArrayList作为参数传递给片段,但该参数似乎是空的。 这是我创建并启动片段的主要活动的代码,顺便说一句,它可以工作 ArrayList<HashMap<String, String>> myeventListRefImages; //has data imageFragment = new ImageMyEventRefFragment(); fragmentManager.findFragmentById(fragmentId);

我试图将ArrayList作为参数传递给片段,但该参数似乎是空的。 这是我创建并启动片段的主要活动的代码,顺便说一句,它可以工作

 ArrayList<HashMap<String, String>> myeventListRefImages;  //has data
 imageFragment = new ImageMyEventRefFragment();
 fragmentManager.findFragmentById(fragmentId);
        if (findViewById(R.id.fragment_image) != null) {
            if (savedInstanceState != null) {
                return;
            }
            getIntent().putExtra("mERImageList", myeventListRefImages); //working
            Bundle bundle = new Bundle(); //doesn’t work
            bundle.putSerializable("mERImageList", myeventListRefImages);//doesn’t work
            imageFragment.setArguments(bundle);
[…]
        }
有什么想法吗?我无法调试片段以检查getArugments注释的值。应用程序刚刚崩溃,但当我正常运行它时,我可以使用System out命令

public void onStart() {
    super.onStart();
    Bundle args = getArguments();//doesn’t work //empty at all
    Bundle extras = getActivity().getIntent().getExtras();//works
    if (args != null) {
System.out.println("Args!");
}
}