我有一个问题,当我从活动传递数组列表到片段...我需要看到只有listivew与复选框选择(从arraylist id),而我看到列表视图之前采取id和从arraylist采取后列表视图...问题将数据从活动传递到片段
我显示我的问题与图片和代码。
与PIC:
之前通数据后
通数据 enter image description here
与代码:
Bundle bundle = new Bundle();
bundle.putIntegerArrayList("oki", hm);
MyListFragment fragment = new MyListFragment();
fragment.setArguments(bundle);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.container, fragment);
transaction.commit();
束代码来获得数据:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
bundle = getArguments();
if (bundle != null) {
strtext=bundle.getIntegerArrayList("oki");
System.out.println("PARAM:"+strtext);
}
}
谁能帮我? 谢谢大家!
从捆绑检索数据的代码在哪里? – Piyush
ArrayList是字符串类型或CustomType类似于模型类型数组列表? –
@ManojSrivastava arraylist包含复选框的编号,以便在整数类型中进行检查,例如 – androidiano