I am pulling my hair out with trying to find a good solution to this problem. I made my app so it finds my location. It seems overly complicated but easy enough. However fol
First to fix your compilation problem, move
LocationManager locationManager = (LocationManager)params[0].getSystemService(Context.LOCATION_SERVICE);
So that it's a private member variable of the class.
LocationManager does not have to be in an AsyncTask. It does not tie up the UI, all updates are already asynchronous. This will just add needless complication to your project.
You probably only need to move useLocation into onLockationChanged.