Search Results

Search found 2 results on 1 pages for 'user1459976'.

Page 1/1 | 1 

  • Android xml Array returning 0 for getIndexCount()

    - by user1459976
    i'm storing data in an xml array in this fashion <resources> <array name="myarray"> <item> <item>attribute1</item> <item>attribute2</item> <item>and so on</item> </item> <item> <item>attribute1</item> <item>attribute2</item> <item>and so on</item> </item> <item> <item>attribute1</item> <item>attribute2</item> <item>and so on</item> </item> </array> </resources> // in program TypedArray array = getResources().obtainTypedArray(R.array.myarray); when i call array.getIndexCount() in the program it returns 0, what is wrong?

    Read the article

  • Java Matrix Transpose strangeness going on

    - by user1459976
    ok so im making my own Matrix class. and i have a transpose method that transposes a matrix. this is the block in the main method Matrix m1 = new Matrix(4,2); m1.fillMatrix(1,2,3,4,5,6,7,8); System.out.println("before " + m1.toString()); m1.transpose(); System.out.println("after " + m1.toString()); this is where it gets messed up, at m1.transpose(); in the transpose() method public Matrix transpose() { if(isMatrix2) { Matrix tempMatrix = new Matrix(row, col); // matrix2 contents are emptied once this line is executed for(int i=0; i < row; i++) { for(int j=0; j < col; j++) tempMatrix.matrix2[i][j] = matrix2[i][j]; } so for some reason, the tempMatrix.matrix2 has the same id as this.matrix2. so when the codes executes Matrix tempMatrix = new Matrix(row,col); then the contents of this.matrix2 is emptied. anyone know what might be going on here?

    Read the article

1