How are you getting the location? are you using locationListenerr and did you block the process with InfiniteProgress?
If you post what you've tried, you will get help fast.
Here is another way to read location
public static Double Lat = 0.0;
public static Double Long = 0.0;
public void GetMyLocation() {
final LocationManager lm = LocationManager.getLocationManager();
InfiniteProgress ip = new InfiniteProgress();
final Dialog ipDlg = ip.showInifiniteBlocking();
Command back = new Command("Back") {
@Override
public void actionPerformed(ActionEvent ev) {
ipDlg.dispose();
//Here I get the device last known location when user press back
Location loc = lm.getLastKnownLocation();
Lat = loc.getLatitude();
Long = loc.getLongitude() ;
}
};
ipDlg.setBackCommand(back);
class MyLocationListener implements LocationListener, Runnable {
boolean locationReady;
public void locationUpdated(Location loc) {
locationReady = true;
Lat = loc.getLatitude();
Long = loc.getLongitude();
}
public void providerStateChanged(int newState) {
// check for unavailable errors etc.
status = newState;
locationReady = true;
}
public void run() {
while (!locationReady) {
try {
//set to end process after 20 seconds if current location is not found and use device last known location
Thread.sleep(20000);
ipDlg.dispose();
Location loc = lm.getLastKnownLocation();
Lat = loc.getLatitude();
Long = loc.getLongitude();
} catch (InterruptedException err) {
}
}
}
}
MyLocationListener m = new MyLocationListener();
lm.setLocationListener(m);
Display.getInstance().invokeAndBlock(m);
ipDlg.dispose();
lm.setLocationListener(null);
Log.p("Lat: " + Lat);
Log.p("Long: " + Long);
}