0

What is the simplest way to transfer (save/load) the values of an array variable (i.c. the variable has the form of int [10][100], so 1000 values) between two activities?

Steven
  • 289
  • 2
  • 5
  • 14

1 Answers1

1

In your first Activity:

int[][] myArray = new int[10][100];

Intent intent = new Intent();
intent.putExtra("myArrayKey", myArray);
startActivity(intent);

And in your second Activity:

int[][] myArray = (int[][]) getIntent().getSerializableExtra("myArrayKey");