forked from upstream-mirrors/OpenTracks
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:
@@ -22,7 +22,6 @@ import com.google.android.accounts.AccountManagerFuture;
|
||||
import com.google.android.accounts.AuthenticatorException;
|
||||
import com.google.android.accounts.OperationCanceledException;
|
||||
import com.google.android.apps.mytracks.AccountChooser;
|
||||
import com.google.android.apps.mytracks.MyTracks;
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
|
||||
import android.app.Activity;
|
||||
@@ -183,7 +182,9 @@ public class ModernAuthManager implements AuthManager {
|
||||
public void run() {
|
||||
accountManager.invalidateAuthToken(Constants.ACCOUNT_TYPE,
|
||||
authToken);
|
||||
MyTracks.getInstance().getAccountChooser().chooseAccount(activity,
|
||||
|
||||
AccountChooser accountChooser = new AccountChooser();
|
||||
accountChooser.chooseAccount(activity,
|
||||
new AccountChooser.AccountHandler() {
|
||||
@Override
|
||||
public void handleAccountSelected(Account account) {
|
||||
|
||||
Reference in New Issue
Block a user