android - How to register callback of App Invite Dialogue -


this code working fine.i am getting invitaton. of code working .

q)how show log messages of callback.

q) why can not log messages in logcat.

if (appinvitedialog.canshow()) {         appinvitecontent content = new appinvitecontent.builder()                 .setapplinkurl(appurl)                 .build();          appinvitedialog appinvitedialog = new appinvitedialog(getactivity());         appinvitedialog.registercallback(scallbackmanager,                 new facebookcallback<appinvitedialog.result>() {                     @override                     public void onsuccess(appinvitedialog.result result) {                         log.d("invitation", "invitation sent successfully");                         toast.maketext(getactivity(), "invitation sent succseesfully", toast.length_long).show();                      }                      @override                     public void oncancel() {                         log.d("invitation", "invitation cancel successfully");                     }                      @override                     public void onerror(facebookexception e) {                         log.d("invitation", "error occured");                     }                 });          appinvitedialog.show(content);     } }  @override public void onactivityresult(int requestcode, int resultcode, intent data) {     super.onactivityresult(requestcode, resultcode, data);     scallbackmanager.onactivityresult(requestcode, resultcode,data);   } 

note : register callback in onactivitresutl.

please suggest if question wrong. new on stackoverflow.

edit

when use same code activity works when use fragment not work. why explanation or code error ?

try pass "fragmentname.this" instead of "getactivity" if registering fragment.

appinvitedialog appinvitedialog = new appinvitedialog(this); 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -