putStringArray() using String 2-Dimensional array (String[][] )

后端 未结 3 1188
失恋的感觉
失恋的感觉 2021-01-07 08:00

I want to pass a 2-D String Array to another activity. My S2-D String Array (String[][]) is \'selected_list\'.

code is :

     Bundle list_bundle=new         


        
3条回答
  •  花落未央
    2021-01-07 08:34

    You can use putSerializable. Arrays are serializable, provided their elements are.

    To store:

    list_bundle.putSerializable("lists", selected_list);
    

    To access:

    String[][] selected_list = (String[][]) bundle.getSerializable("lists");
    

提交回复
热议问题