From my previous question
I was getting NullPointor exception. So i have done some changes in my code and now progress bar is showing up but getting the below error
Can't create handler inside thread that has not called Looper.prepare()
You are accessing something on the UI thread from inside doInBackground. And that's not allowed.
*edit: I've seen everything. To me, what looks mostly unusual are those lines:
updateWithNewLocation(location); // What does this do? Could you tell me?
locationManager.requestLocationUpdates(provider, 2000, 10,
locationListener); // I don't think this is it
Try to move all those location update stuff into the onProgressUpdate. I'm blind here since I can't see your code, but I'm guessing it does something with the UI. Try this:
@Override
protected void onProgressUpdate(Location... locations) {
super.onProgressUpdate(values);
updateWithNewLocation(location);
}
But as I said, I'm not sure since I can't know what updateWithNewLocation does unless you post that code here.