forked from upstream-mirrors/OpenTracks
Getting rid of unused DialogManager calls.
This commit is contained in:
@@ -34,28 +34,6 @@ import android.view.WindowManager.BadTokenException;
|
||||
*/
|
||||
public class DialogManager {
|
||||
|
||||
private MyTracks activity;
|
||||
|
||||
public DialogManager(MyTracks activity) {
|
||||
this.activity = activity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows a dialog with the given message.
|
||||
* Does it on the UI thread.
|
||||
*
|
||||
* @param success if true, displays an info icon/title, otherwise an error
|
||||
* icon/title
|
||||
* @param message resource string id
|
||||
*/
|
||||
public void showMessageDialog(final int message, final boolean success) {
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
showMessageDialog(activity, message, success, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void showMessageDialog(
|
||||
Context ctx, int message, boolean success, DialogInterface.OnClickListener okListener) {
|
||||
AlertDialog dialog = null;
|
||||
@@ -68,27 +46,6 @@ public class DialogManager {
|
||||
dialog = builder.create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Just like showDialog, but will catch a {@link BadTokenException} that
|
||||
* sometimes (very rarely) gets thrown. This might happen if the user hits
|
||||
* the "back" button immediately after sending tracks to google.
|
||||
*
|
||||
* @param id the dialog id
|
||||
*/
|
||||
public void showDialogSafely(final int id) {
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
activity.showDialog(id);
|
||||
} catch (BadTokenException e) {
|
||||
Log.w(TAG, "Could not display dialog with id " + id, e);
|
||||
} catch (IllegalStateException e) {
|
||||
Log.w(TAG, "Could not display dialog with id " + id, e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The equivalent of {@link #showDialogSafely(int)}, but for a specific
|
||||
@@ -108,21 +65,6 @@ public class DialogManager {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Dismisses the progress dialog if it is showing. Executed on the UI thread.
|
||||
*/
|
||||
public void dismissDialogSafely(final int id) {
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
activity.dismissDialog(id);
|
||||
} catch (IllegalArgumentException e) {
|
||||
// This will be thrown if this dialog was not shown before.
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The equivalent of {@link #dismissDialogSafely(int)}, but for a specific
|
||||
* dialog instance.
|
||||
@@ -138,4 +80,6 @@ public class DialogManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private DialogManager() {}
|
||||
}
|
||||
|
||||
@@ -63,11 +63,6 @@ import android.widget.Toast;
|
||||
public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
private TrackDataHub dataHub;
|
||||
|
||||
/*
|
||||
* Dialogs manager.
|
||||
*/
|
||||
private DialogManager dialogManager;
|
||||
|
||||
/*
|
||||
* Menu manager.
|
||||
*/
|
||||
@@ -135,7 +130,6 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
preferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
dataHub = new TrackDataHub(this, preferences, providerUtils);
|
||||
menuManager = new MenuManager(this);
|
||||
dialogManager = new DialogManager(this);
|
||||
serviceBinder = TrackRecordingServiceBinder.getInstance(this);
|
||||
|
||||
// The volume we want to control is the Text-To-Speech volume
|
||||
|
||||
Reference in New Issue
Block a user