Login callback is not triggered using facebook-android-sdk 4 -
i have activity user login facebook. used facebook-android-sdk v4.0.0. login callback not triggered when user click on login button. after showing progress bar, start previous activity automatically without showing error on log instead of triggering login callback.
in signupactivity,
private callbackmanager callbackmanager; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_sign_up); callbackmanager = callbackmanager.factory.create(); loginbutton loginbutton = (loginbutton) findviewbyid(r.id.login_btn); loginbutton.setreadpermissions(arrays.aslist("user_friends", "email")); loginbutton.registercallback(callbackmanager, new facebookcallback<loginresult>() { @override public void onsuccess(loginresult loginresult) { log.i("login : ", "success"); } @override public void oncancel() { log.i("login : ", "cancel"); } @override public void onerror(facebookexception e) { log.e("login error : ", e.getmessage() + ""); } }); } @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); callbackmanager.onactivityresult(requestcode, resultcode, data); }
i added meta-data element application element , facebookactivity manifest. moreover, finished initializing facebook sdk in application :
@override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); facebooksdk.sdkinitialize(getapplicationcontext()); }
what's wrong code ? suggestion !!
edit
i found myself what's wrong code. start signupactivity no_history flag. after remove flag, okay now.
Comments
Post a Comment