@Override protected void onStop() { super.onStop(); CancelableAssynTask.cancel(pontosEOnibusTask); application.getLocation().unRegisterObserver(this); if (locationIntent != null) { stopService(locationIntent); locationIntent = null; } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); AppRater.app_launched(this); application = (BusaoApplication) getApplication(); cache = application.getCache(); if (application.getLocation() == null) { application.setLocation(new LocationControl(this)); } if (locationIntent != null) { stopService(locationIntent); } locationIntent = new Intent(this, LocationService.class); startService(locationIntent); progressBarAdministrator = new ProgressBarAdministrator(this); pontosExpandableListView = (PontoExpandableListView) findViewById(R.id.listPonto); application.getLocation().registerObserver(this); initializeSherlockActionBar(); }