我想使用我使用的包发送一个2D数组:
//TO SEND
Bundle b = new Bundle();
b.putSerializable("value",string_array);
//TO GET
String[][] array_string = (String[][]) b.getSerializable("value");
但是我收到以下错误:
02-19 08:22:58.582: E/AndroidRuntime(2412): FATAL EXCEPTION: main
02-19 08:22:58.582: E/AndroidRuntime(2412): java.lang.RuntimeException: Unable to start
activity ComponentInfo{com.example.statlite/com.example.statlite.GraphActivity}:
java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.String[][]
答案 0 :(得分:0)
In Activity A
String[] arrayName;
Bundle bundle =new Bundle();
bundle.putStringArray("IntentName",arrayName);
In Activity B
String receivingArrayName[]=bundle.getStringArray("IntentName");