简体   繁体   English

Android应用程序的Facebook集成

[英]facebook integration of android app

While facebook integration of my android app, I defined a facebook Activity for login and its working fine. 在整合我的android应用程序的facebook的同时,我为登录及其运行状态定义了一个Facebook Activity。 Now in the same activity I define a publishFeed method, which I need to call from a different fragment of my app. 现在,在同一活动中,我定义了一个publishFeed方法,我需要从我的应用程序的另一个片段中调用该方法。 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. 现在,如果我可以单击其他片段中的某个按钮,则可以使用publishFeed方法,那么在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. 我正在通过创建活动对象来从facebook活动类中调用该方法,然后调用publishFeed方法。 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. https://github.com/facebook/facebook-android-sdk/tree/master/samples下载示例并运行hello facebook示例应用程序。 To integrate your app with latest facebook sdk you need to generate hash key and app id. 要将您的应用程序与最新的Facebook SDK集成,您需要生成哈希键和应用程序ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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