android - Java for-loop never terminates -


I am trying to make a basic for loop which connects elements of the temporary list to the main arrives. This crashes my Android app repeatedly.

 for  (int i = 0; i & lt; tempFavList.size (); i ++) {log. v ("MyApp", Integer.toString (tempFavList.size ())); favourites.add (tempFavList.get (i) .toString ()); } Some debugging has shown that for  tempFavList.size ()  the first of the loop is equal to 2 but goes to infinity when loop's (At least + 500,000 before the app crashes)  tempFavList = currentUser.getList ("Favorites");   

I have a list extracted from the pars database to the tempFavList list; Quite confused why the temporary list size is increasing once for the loop because I am not adding any item for the loop.

You can try:

  last int tempSize = tempFavList .size (); For (Int i = 0; I    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -