How use LocationManager inside Timer?

view story

http://stackoverflow.com – in my app I have a Background server and inside server class I have timer and inside timer I have a locationManager to find location : LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); LocationListener locationListener = new MyLocationListener(); locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, 5000, 10, locationListener); but here I got this error : java.lang.runtimeexception can't create handler inside thread that has not (HowTos)