我正在开发一个简单的应用程序,其中包含带有片段的 tabview。我被困在了必须将数据传递给 tabselect 上新创建的片段的地方。
我有一个我的自定义类对象列表列表:
List<List<NewsObjectClass>> myList;
这是我卡住的地方:
public static class PlaceholderFragment extends ListFragment{
private static final String ARG_SECTION_NUMBER = "section_number";
public PlaceholderFragment(){
}
public static PlaceholderFragment newInstance(int sectionNumber, List<List<NewsObjectsClass>> data) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
// Here i want to pass my List<List<NewsObjectClass>> to the bundle
fragment.setArguments(args);
return fragment;
}
...
所以具体来说,我需要一种方法如何将 myCustomObjects 的 lsits 列表传递给片段,这样我就可以将它用于 lsitview 适配器。
关于如何传递此类数据的任何 syggestions 都会很棒。谢谢。