Closed SezerFidanci closed 1 year ago
Well, your implementation looks good. It seems you have indeed read the documentation well and checked other issues for a solution. Thank you!
Did you try this on a real device or on the emulator? If it’s the latter, try a real device instead.
In the onClick
callback of your View.OnClickListener
, the call
location.beginUpdates();
is definitely redundant. You can safely remove that.
Copy your Log.i
call and paste it at the end of the onPositionChanged
callback of SimpleLocation.Listener
. Of course, it might make sense to change the message string as well. Otherwise, you don’t see when new location data becomes available.
Try changing the second argument of the constructor from true
to false
to switch between GPS location and network location.
Does that help?
In general, this is unfortunately quite a common problem, but still one that can easily be solved, I’d say:
If you target a newer Android platform, you should ask a user for access to their location explicitly. https://developer.android.com/training/permissions/requesting
when i am overriding the onResume method my UI get stuck and black screen occur any suggestions
Hi, I followed the instructions in the readme file. But result Lat: 0.0, Lon: 0.0
`package app.meysta;
import android.app.Activity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android.widget.TextView;
import im.delight.android.location.SimpleLocation;
public class Splash extends Activity {
} `