Search in sources :

Example 1 with IAuthenticationCallback

use of com.newsrob.auth.IAuthenticationCallback in project newsrob by marianokamp.

the class AccountListActivity method doAuth.

protected void doAuth(final String accountName) {
    final IAuthenticationCallback callback = new IAuthenticationCallback() {

        @Override
        public void onError(Exception e) {
            AccountListActivity.this.onError(e);
        }

        @Override
        public void onAuthTokenReceived(String googleAccount, String authToken) {
            EntryManager entryManager = EntryManager.getInstance(AccountListActivity.this);
            entryManager.doLogin(googleAccount, authToken);
            LoginActivity.onSuccess(entryManager, googleAccount);
            SDK9Helper.apply(entryManager.getSharedPreferences().edit().remove(EntryManager.SETTINGS_PASS));
            AccountListActivity.this.finish();
        }
    };
    accountManagementUtils.getAuthToken(AccountListActivity.this, handler, callback, accountName);
}
Also used : IAuthenticationCallback(com.newsrob.auth.IAuthenticationCallback) EntryManager(com.newsrob.EntryManager) IOException(java.io.IOException) BadTokenException(android.view.WindowManager.BadTokenException)

Aggregations

BadTokenException (android.view.WindowManager.BadTokenException)1 EntryManager (com.newsrob.EntryManager)1 IAuthenticationCallback (com.newsrob.auth.IAuthenticationCallback)1 IOException (java.io.IOException)1