forked from upstream-mirrors/OpenTracks
And the moment we've been all waiting for....MyTracks is no longer a singleton.
This commit is contained in:
@@ -107,7 +107,7 @@ public class ChartActivity extends Activity implements TrackDataListener {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
Log.w(TAG, "ChartActivity.onCreate");
|
||||
super.onCreate(savedInstanceState);
|
||||
dataHub = MyTracks.getInstance().getDataHub();
|
||||
dataHub = TrackDataHub.getInstance(this);
|
||||
|
||||
// The volume we want to control is the Text-To-Speech volume
|
||||
int volumeStream =
|
||||
|
||||
@@ -123,7 +123,7 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
||||
// ------------------------
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
protected void onCreate(Bundle bundle) {
|
||||
Log.d(TAG, "MapActivity.onCreate");
|
||||
super.onCreate(bundle);
|
||||
|
||||
@@ -132,7 +132,7 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
||||
new StatusAnnouncerFactory(ApiFeatures.getInstance()).getVolumeStream();
|
||||
setVolumeControlStream(volumeStream);
|
||||
|
||||
dataHub = MyTracks.getInstance().getDataHub();
|
||||
dataHub = TrackDataHub.getInstance(this);
|
||||
|
||||
// We don't need a window title bar:
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
|
||||
@@ -120,7 +120,6 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
Log.d(TAG, "MyTracks.onCreate");
|
||||
super.onCreate(savedInstanceState);
|
||||
instance = this;
|
||||
ApiFeatures apiFeatures = ApiFeatures.getInstance();
|
||||
if (!SystemUtils.isRelease(this)) {
|
||||
apiFeatures.getApiPlatformAdapter().enableStrictMode();
|
||||
@@ -480,11 +479,4 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
public TrackDataHub getDataHub() {
|
||||
return dataHub;
|
||||
}
|
||||
|
||||
// TODO: Remove very soon
|
||||
private static MyTracks instance;
|
||||
|
||||
public static MyTracks getInstance() {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,11 +105,11 @@ public class StatsActivity extends Activity implements TrackDataListener {
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
preferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
dataHub = MyTracks.getInstance().getDataHub();
|
||||
dataHub = TrackDataHub.getInstance(this);
|
||||
utils = new StatsUtilities(this);
|
||||
|
||||
// The volume we want to control is the Text-To-Speech volume
|
||||
|
||||
@@ -180,7 +180,6 @@ public class MyTracksTest extends ActivityInstrumentationTestCase2<MyTracks>{
|
||||
|
||||
private void assertInitialized() {
|
||||
assertNotNull(getActivity());
|
||||
assertNotNull(MyTracks.getInstance());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user