code: public OAuthFuture<Credential> authorizeImplicitly(final String userId,
              final OAuthCallback<Credential> callback, Handler handler) {
          Preconditions.checkNotNull(userId);
  
          final Future2Task<Credential> task = new Future2Task<Credential>(handler, callback) {
  
              @Override
              public void doWork() throws TokenResponseException, Exception {
                  try {
                      LOGGER.info("authorizeImplicitly");
                      Credential credential = mFlow.loadCredential(userId);
                      if (credential != null && credential.getAccessToken() != null
                              && (credential.getRefreshToken() != null ||
                                      credential.getExpiresInSeconds() == null ||
                              credential.getExpiresInSeconds() > 60)) {
                          set(credential);
                          return;
                      }
  
                      String redirectUri = mUIController.getRedirectUri();
  
                      BrowserClientRequestUrl authorizationUrl = mFlow.newImplicitAuthorizationUrl()
                              .setRedirectUri(redirectUri);
                      mUIController.requestAuthorization(authorizationUrl);
  
                      ImplicitResponseUrl implicitResponse = mUIController
                              .waitForImplicitResponseUrl();
                      credential = mFlow.createAndStoreCredential(implicitResponse, userId);
                      set(credential);
                  } finally {
                      mUIController.stop();
                  }
              }
  
          };
  
          // run the task in a background thread
          submitTaskToExecutor(task);
  
          return task;
      }
docs: Authorizes the Android application to access user's protected data using
  the Implicit Authorization flow in OAuth 2.0.
  
  @param userId user ID or {@code null} if not using a persisted credential
  store
  @param callback Callback to invoke when the request completes,
  {@code null} for no callback
  @param handler {@link Handler} identifying the callback thread,
  {@code null} for the main thread
  @return An {@link OAuthFuture} which resolves to a {@link Credential}