Skip to content

Commit

Permalink
No need to dismiss diaglog - activity is finished
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkel committed Jan 11, 2018
1 parent a6398bf commit 5c65fe8
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class AccountManagerAuthActivity extends AppCompatActivity {

public static final String AUTH_TOKEN_TYPE = "oauth2:https://mail.google.com/";
public static final String GOOGLE_TYPE = "com.google";
private static final String PROGRESS_TAG = "progress";

private AccountManager accountManager;

Expand All @@ -59,7 +58,7 @@ public void onCreate(Bundle savedInstanceState) {
}

private void onAccountSelected(final Account account) {
new AccessTokenProgress().show(getSupportFragmentManager(), PROGRESS_TAG);
new AccessTokenProgress().show(getSupportFragmentManager(), null);
accountManager.getAuthToken(account, AUTH_TOKEN_TYPE, null, this,
new AccountManagerCallback<Bundle>() {
public void run(AccountManagerFuture<Bundle> future) {
Expand All @@ -69,11 +68,6 @@ public void run(AccountManagerFuture<Bundle> future) {
onAccessDenied();
} catch (Exception e) {
handleException(e);
} finally {
Fragment fragment = getSupportFragmentManager().findFragmentByTag(PROGRESS_TAG);
if (fragment instanceof DialogFragment) {
((DialogFragment)fragment).dismissAllowingStateLoss();
}
}
}
}, null);
Expand Down

0 comments on commit 5c65fe8

Please sign in to comment.