mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-05 11:03:06 +02:00
Removing singleton usage: moving all send and save logic out of the MyTracks class.
This is a non-trivial step: I decentralized dialog creation (since it made no sense to have a single place creating a lot of completely unrelated dialogs), made invisible activities just for sending/saving, and changed menu handling a bit, all to decentralize those functions from MyTracks. There's still a TODO to handle GET_LOGIN more nicely instead of returning from the depths of auth management into the current activity.
This commit is contained in:
@@ -29,7 +29,7 @@ import android.util.Log;
|
||||
* @author Sandor Dornbush
|
||||
*/
|
||||
public class AccountChooser {
|
||||
|
||||
|
||||
/**
|
||||
* The last selected account.
|
||||
*/
|
||||
@@ -68,13 +68,13 @@ public class AccountChooser {
|
||||
handler.handleAccountSelected(accounts[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// TODO This should be read out of a preference.
|
||||
if (selectedAccount != null) {
|
||||
handler.handleAccountSelected(selectedAccount);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Let the user choose.
|
||||
Log.e(Constants.TAG, "Multiple matching accounts found.");
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
|
||||
Reference in New Issue
Block a user