简体   繁体   中英

facebook integration of android app

While facebook integration of my android app, I defined a facebook Activity for login and its working fine. Now in the same activity I define a publishFeed method, which I need to call from a different fragment of my app. Now if I can the publishFeed method on the click of some button in my other fragment I get the following errors in my LogCat.

05-15 14:18:04.667: W/System.err(4997): java.lang.IllegalStateException: System services not available to Activities before onCreate()
05-15 14:18:04.677: W/audio_hw_primary(945): out_write() limiting sleep time 34829 to 23219
05-15 14:18:04.707: W/System.err(4997):     at android.app.Activity.getSystemService(Activity.java:4492)
05-15 14:18:04.707: W/System.err(4997):     at android.app.Dialog.<init>(Dialog.java:163)
05-15 14:18:04.707: W/System.err(4997):     at android.app.Dialog.<init>(Dialog.java:147)
05-15 14:18:04.707: W/System.err(4997):     at com.facebook.widget.WebDialog.<init>(WebDialog.java:133)
05-15 14:18:04.707: W/System.err(4997):     at com.facebook.widget.WebDialog$BuilderBase.build(WebDialog.java:542)
05-15 14:18:04.707: W/System.err(4997):     at com.facebook.widget.WebDialog$FeedDialogBuilder.build(WebDialog.java:1)

Please guide me in right direction. What is it that I am missing. I am calling the method from facebook activity class by creating an object of that and then calling the publishFeed method. Thanks everyone for going through my query

Download samples from https://github.com/facebook/facebook-android-sdk/tree/master/samples and run hello facebook sample application. To integrate your app with latest facebook sdk you need to generate hash key and app id.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM