Making TrackDataHub an application singleton (using the application context to ensure we don't leak MyTracks).

This commit is contained in:
Rodrigo Damazio
2011-06-01 01:39:51 -03:00
parent 111adc917b
commit 3e773ef94b
3 changed files with 54 additions and 38 deletions
@@ -128,7 +128,7 @@ public class MyTracks extends TabActivity implements OnTouchListener {
providerUtils = MyTracksProviderUtils.Factory.get(this);
preferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
dataHub = new TrackDataHub(this, preferences, providerUtils);
dataHub = TrackDataHub.getInstance(this);
menuManager = new MenuManager(this);
serviceBinder = TrackRecordingServiceBinder.getInstance(this);
@@ -174,15 +174,6 @@ public class MyTracks extends TabActivity implements OnTouchListener {
Eula.showEulaRequireAcceptance(this);
}
@Override
protected void onDestroy() {
Log.d(TAG, "MyTracks.onDestroy");
dataHub.destroy();
super.onDestroy();
}
@Override
protected void onStop() {
Log.d(TAG, "MyTracks.onStop");