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) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
Log.w(TAG, "ChartActivity.onCreate");
|
Log.w(TAG, "ChartActivity.onCreate");
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
dataHub = MyTracks.getInstance().getDataHub();
|
dataHub = TrackDataHub.getInstance(this);
|
||||||
|
|
||||||
// The volume we want to control is the Text-To-Speech volume
|
// The volume we want to control is the Text-To-Speech volume
|
||||||
int volumeStream =
|
int volumeStream =
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
|||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle bundle) {
|
protected void onCreate(Bundle bundle) {
|
||||||
Log.d(TAG, "MapActivity.onCreate");
|
Log.d(TAG, "MapActivity.onCreate");
|
||||||
super.onCreate(bundle);
|
super.onCreate(bundle);
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
|||||||
new StatusAnnouncerFactory(ApiFeatures.getInstance()).getVolumeStream();
|
new StatusAnnouncerFactory(ApiFeatures.getInstance()).getVolumeStream();
|
||||||
setVolumeControlStream(volumeStream);
|
setVolumeControlStream(volumeStream);
|
||||||
|
|
||||||
dataHub = MyTracks.getInstance().getDataHub();
|
dataHub = TrackDataHub.getInstance(this);
|
||||||
|
|
||||||
// We don't need a window title bar:
|
// We don't need a window title bar:
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
Log.d(TAG, "MyTracks.onCreate");
|
Log.d(TAG, "MyTracks.onCreate");
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
instance = this;
|
|
||||||
ApiFeatures apiFeatures = ApiFeatures.getInstance();
|
ApiFeatures apiFeatures = ApiFeatures.getInstance();
|
||||||
if (!SystemUtils.isRelease(this)) {
|
if (!SystemUtils.isRelease(this)) {
|
||||||
apiFeatures.getApiPlatformAdapter().enableStrictMode();
|
apiFeatures.getApiPlatformAdapter().enableStrictMode();
|
||||||
@@ -480,11 +479,4 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
|||||||
public TrackDataHub getDataHub() {
|
public TrackDataHub getDataHub() {
|
||||||
return dataHub;
|
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. */
|
/** Called when the activity is first created. */
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
preferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
preferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||||
dataHub = MyTracks.getInstance().getDataHub();
|
dataHub = TrackDataHub.getInstance(this);
|
||||||
utils = new StatsUtilities(this);
|
utils = new StatsUtilities(this);
|
||||||
|
|
||||||
// The volume we want to control is the Text-To-Speech volume
|
// 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() {
|
private void assertInitialized() {
|
||||||
assertNotNull(getActivity());
|
assertNotNull(getActivity());
|
||||||
assertNotNull(MyTracks.getInstance());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user