0

我在我的 Android 应用程序中使用了linkedin-j 库。我正在尝试检索 OAuth 身份验证的请求令牌:

LinkedInOAuthService linkedinOAuth = LinkedInOAuthServiceFactory.getInstance().createLinkedInOAuthService(
                  linkedinApiKey,
                  linkedinSecretKey); 
LinkedInRequestToken requestToken = linkedinOAuth.getOAuthRequestToken(MY_CALLBACK_URL);

我收到此错误:

11-19 22:20:56.985: E/AndroidRuntime(17891): com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: null
11-19 22:20:56.985: E/AndroidRuntime(17891):    at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:180)

有谁知道可能是什么原因?

4

1 回答 1

0

解决方案是将 getOAuthRequestToken 放入 AsyncTask 中,以便它与 UI 线程分开运行。

于 2013-11-20T07:16:45.760 回答