Android pass a 2d int array from one activity to another ERROR

Posted by user2189001 on Stack Overflow See other posts from Stack Overflow or by user2189001
Published on 2013-11-05T03:40:23Z Indexed on 2013/11/05 3:53 UTC
Read the original article Hit count: 183

Filed under:
|
|
|

ACTIVITY 1:

Bundle bundle = new Bundle();
bundle.putSerializable("CustomLevelData",  LevelCreator.LCLevelData);
Intent i = new Intent(LevelCreatorPopout.this, GameView.class);
i.putExtras(bundle);
startActivity(i);

ACTIVITY 2:

LevelData=(int[][]) extras.getSerializable("CustomLevelData");

ERROR: E/AndroidRuntime(16220): FATAL EXCEPTION: main E/AndroidRuntime(16220): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.powerpoint45.maze/com.powerpoint45.maze.GameView}: java.lang.ClassCastException: java.lang.Object[] cannot be cast to int[][]

I have searched but found nothing on 2d INT array passing

© Stack Overflow or respective owner

Related posts about java

Related posts about android