Commit a107cc9a authored by Vytor Calixto's avatar Vytor Calixto 👾
Browse files

Alterado nome do locationListener

parent bc520b27
...@@ -2,21 +2,12 @@ package ufpr.inf.pet.geoloc; ...@@ -2,21 +2,12 @@ package ufpr.inf.pet.geoloc;
import android.app.Activity; import android.app.Activity;
import android.app.DialogFragment; import android.app.DialogFragment;
import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.location.Criteria;
import android.location.Location; import android.location.Location;
import android.location.LocationManager; import android.location.LocationManager;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.Display; import android.view.Display;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
public class MainActivity extends Activity { public class MainActivity extends Activity {
...@@ -42,7 +33,7 @@ public class MainActivity extends Activity { ...@@ -42,7 +33,7 @@ public class MainActivity extends Activity {
} }
private MapView mapView; private MapView mapView;
private GelocLocationListener locationListener; private GeolocLocationListener locationListener;
private TilesProvider tilesProvider; private TilesProvider tilesProvider;
private Location savedGpsLocation; private Location savedGpsLocation;
...@@ -187,8 +178,15 @@ public class MainActivity extends Activity { ...@@ -187,8 +178,15 @@ public class MainActivity extends Activity {
protected void onResume() { protected void onResume() {
initViews(); initViews();
restoreMapViewSettings(); restoreMapViewSettings();
locationListener = new GelocLocationListener(mapView); locationListener = new GeolocLocationListener(mapView);
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
boolean isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
if(!isGPSEnabled){
DialogFragment dialog = new EnableGpsDialogFragment();
dialog.show(getFragmentManager(), "habilitar gps");
}
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
setContentView(mapView); setContentView(mapView);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment