在Android应用程序集成Facebook和LinkedIn [英] Integrating Facebook and LinkedIn in Android app

查看:378
本文介绍了在Android应用程序集成Facebook和LinkedIn的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个集成了Facebook和LinkdedIn网络的应用程序。根据指示,为了整合LinkedIn,我需要添加在我的清单如下code,我的活动范围内:

I have an app that integrates both Facebook and LinkdedIn networks. According to the instructions, in order to integrate LinkedIn, I need to add the following code in my manifest, within my activity:

<intent-filter>
   <action android:name="android.intent.action.VIEW" />
   <category android:name="android.intent.category.DEFAULT" />
   <category android:name="android.intent.category.BROWSABLE" />
   <data android:scheme="x-oauthflow-linkedin" android:host="callback" />
</intent-filter>

一个例子也可以找到<一个href=\"https://github.com/alt236/LinkedIn-J-Test-Application---Android/blob/master/AndroidManifest.xml\"相对=nofollow>此处。正如你可以在链接看到的,我们还需要添加的android:launchMode =singleInstance行,与LinkedIn登陆活动的一个新的实例将被启动后,否则。

An example can also be found here. As you can see in the link, we need to add also the " android:launchMode="singleInstance" " line, otherwise after logging in with LinkedIn a new instance of the activity will be started.

不过,试图从同一个活动登录到Facebook时,该行的实际结果与Facebook的登录活动以下错误(!):

However, when trying to log in to Facebook from the same activity, this actual line results to the following error from the Facebook Login activity (!):

E / AndroidRuntime(7100):com.facebook.FacebookException:产生的原因无法调用LoginActivity用空调用包。如果呼叫者的launchMode是singleInstance会发生这种情况。

所以,现在,我莫名其妙地卡住了,因为删除的android:launchMode =singleInstance将使得Facebook登录工作,但会造成LinkedIn登录,开始我的活动的另一个实例,但如果我添加它,那么Facebook登录不工作!

So now, I'm somehow stuck, because removing android:launchMode="singleInstance" will make Facebook login working, but will cause the LinkedIn login to start another instance of my activity, but if I add it, then Facebook login is not working!

有没有人有任何想法如何解决这个问题?

Does anyone have any idea how to address this issue?

感谢您,

季米特里斯·

推荐答案

文档阅读上点点之后,似乎与singleTask更换singleInstance做的伎俩。虽然,我还没有想出究竟为什么,我张贴这种给别人看它,万一有人需要它。我会尝试进一步挖掘和了解为什么,但在此期间,如果任何人都可以解释为什么这是工作,这将是很好。

After reading little bit on the documentation, it seems that replacing the singleInstance with singleTask did the trick. Although, I haven't figured out exactly why, I am posting this for others to see it in case someone needs it. I'll try to dig further and understand why, but in the mean time if anyone can explain why this is working, it would be nice.

这篇关于在Android应用程序集成Facebook和LinkedIn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆