android - UserRecoverableAuthException: intent not firing up -


i trying fire window application asks user give consent application access user data via googleauthutil.gettoken().

however cannot see activity fired userrecoverableauthexception.

i've searched not found helpful posts resolve issue.

anyone have ideas? (the "shoot2!" printed out nothing happens in logcat after that).

  @override   public void oncreate(bundle savedinstancestate) {      super.oncreate(savedinstancestate);      system.out.println("here!!!");     system.out.println(calendarscopes.calendar);      new asynctask<void, void, void>() {        @override       protected void doinbackground(void... params) {          try {           system.out.println("hello2!");           string token = googleauthutil.gettoken(eventsactivity.this, "jdoe@gmail.com", "oauth2:" + calendarscopes.calendar);           system.out.println("token");           system.out.println("hello3!");         } catch (googleplayservicesavailabilityexception playex) {           system.out.println("shoot1!");           playex.printstacktrace();         } catch (userrecoverableauthexception recoverableexception) {           system.out.println("shoot2!");           intent recoveryintent = recoverableexception.getintent();           recoveryintent.addflags(intent.flag_activity_new_task).addflags(intent.flag_from_background);           // use intent in custom dialog or startactivityforresult.           startactivityforresult(recoveryintent, 99);         } catch (googleauthexception authex) {           system.out.println("shoot3!");           // unrecoverable.           authex.printstacktrace();         } catch (ioexception ioex) {           system.out.println("shoot4!");           ioex.printstacktrace();         }          return null;        } }.execute(); 

i discovered in case authorization intent wasn't been fired because added singleinstance activity in androidmanifest.xml

removing

android:launchmode = "singleinstance"

fixed problem , couple of other strange transition effects between activities.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -