i using facebook sdk 4.0 inmy android app. have activity functionality post message facebook ( not main activity of app ) doing following login facebook , post message
facebooksdk.sdkinitialize(this.getapplicationcontext()); callbackmanager = callbackmanager.factory.create(); loginmanager.getinstance().registercallback(callbackmanager, new facebookcallback<loginresult>() { @override public void onsuccess(loginresult loginresult) { //login successfull, post message. } });
questions is, how unregister callback loginmanager ? didnt find method in loginmanager so.
any reason why sdk designed in such way doesnt provide option unregister ?
problem is, if activity gets destroyed , recreated ( say, due device rotation) , loginmanager have reference previous activity instance not right.
i unregister in ondestory of activity.
thanks,
the loginmanager not hold reference callback, callback manager does. long keep callback manager 1-1 activity, callback garbage collected fine.
Comments
Post a Comment