Exactly as the question title says, I'm trying to save a 2d int array during onSaveInstanceState, tried the obvious:
outState.putIntArray("matrix",matrix);
got:
Error:(58, 39) error: incompatible types: int[][] cannot be converted to int[]
What am I suppossed to do?
There is no suitable method to store the matrix directly. But there are methods for storing one dimensional arrays. So what you are looking for is how to represent two dimensional array as one dimensional. Here is a good starting point on how to do that - Algorithm to convert a multi-dimensional array to a one-dimensional array