fabric twitter - twitterLoginButton.performClick(); not working in android -


i tried perform click programmatic way, app getting crash everytime.

twitterloginbutton = (twitterloginbutton) findviewbyid(r.id.twitterlogin);     twitterloginbutton.performclick();     twitterloginbutton.setpressed(true);     twitterloginbutton.invalidate();     //adding callback button     twitterloginbutton.setcallback(new callback<twittersession>() {         @override         public void success(result<twittersession> result) {             //if login succeeds passing calling login method , passing result object             twitterlogin(result);         }         @override         public void failure(twitterexception exception) {             //if failure occurs while login handle here             log.d("twitterkit", "login twitter failure", exception);         }     });     twitterloginbutton.setpressed(false);     twitterloginbutton.invalidate(); 

given below error. manual button clicks working fine, cannot figure_out problem...

 fatal exception: main java.lang.runtimeexception: unable start activity  componentinfo{com.tettares.whatdoieat/com.tettares.whatdoieat.login.fbortwitterloginactivity}: java.lang.illegalargumentexception: callback must not null   @ android.app.activitythread.performlaunchactivity(activitythread.java:2339)  @ android.app.activitythread.handlelaunchactivity(activitythread.java:2413)  @ android.app.activitythread.access$800(activitythread.java:155)   @ android.app.activitythread$h.handlemessage(activitythread.java:1317)   @ android.os.handler.dispatchmessage(handler.java:102)at android.os.looper.loop(looper.java:135)  @ android.app.activitythread.main(activitythread.java:5343) @ java.lang.reflect.method.invoke(native method)  @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:905)   @ com.android.internal.os.zygoteinit.main(zygoteinit.java:700)  caused by: java.lang.illegalargumentexception: callback must not null. @    com.twitter.sdk.android.core.identity.twitterauthclient.authorize(twitterauthclient.java:95)at    com.twitter.sdk.android.core.identity.twitterloginbutton$loginclicklistener.onclick(twitterloginbutton.java:161)    @ android.view.view.performclick(view.java:4785) 

call twitterloginbutton.performclick(); after set callback


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -