java - Add value to arrayList in android -


I am trying to add the difference value in the array list

  ArrayList & lt; Integer & gt; arraylistPage1; {Int x = 0; for int j = 1; j and lt; = total page; j ++); (Int i = 1; i & lt; = rangeMode; i ++) {if (binary table [i] [j] == 1) {cardInPage [j] [x] = i; System.out.println ("Card Number:" + i); ArraylistPage1.add (i); Println (arraylistPage1); X ++; }} System.out.println ("Page -" + + "Total Card:" + + x); TotalCardInPage [J] = X; }   

But when I run it, the program stops.

Does anyone know how to fix this?

Thanks

Change the code to

  ArrayList & lt; Integer & gt; arraylistPage1; {Int x = 0; for int j = 1; j and lt; = total page; j ++); Array list page 1 = new arreelist & lt; Integer & gt; (Border mode); (Int i = 1; i & lt; = rangeMode; i ++) {if (binary table [i] [j] == 1) {cardInPage [j] [x] = i; System.out.println ("Card Number:" + i); ArraylistPage1.add (i); Println (arraylistPage1); X ++; }} System.out.println ("Page -" + + "Total Card:" + + x); TotalCardInPage [J] = X; }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -