while loop with query

1982
1
10-15-2014 01:55 AM
SaidHamri
New Contributor

Hello everyone, I am trying to use a while loop on my Android application but the application freezes. What I'm trying to do is track the user location (using onlocationChanged) and keep querying a FeatureLayer until the query returns a result. I am using a boolean "noResults" that is changed to false on the query callback(in order to stop the while loop)  here's what I did: "while(noResults) { //query code here }. " Is there anything I should change in the loop? are there any other alternatives to the while loop that keeps the application from freezing?

0 Kudos
1 Reply
EricBader
Occasional Contributor III

Is this work happening on a background thread, using AsyncTask?

It could be that something is bailing out in your loop...maybe.

0 Kudos