Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double latitude;
- double longitude;
- public void getLocation() {
- LocationManager mlocManager=null;
- LocationListener mlocListener;
- mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
- mlocListener = new MyLocationListener();
- mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener);
- if (mlocManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
- if(MyLocationListener.latitude>0)
- {
- latitude = MyLocationListener.latitude;
- longitude = MyLocationListener.longitude;
- makeMap();
- }
- else
- {
- alert.setTitle("Wait");
- alert.setMessage("GPS in progress, please wait.");
- alert.setPositiveButton("OK", null);
- alert.show();
- }
- }
- }
Add Comment
Please, Sign In to add comment