我正在尝试将 LinkedIn 与 android 集成。使用教程我应用了以下代码......
private void setWebView()
{
LinkedinDialog.oAuthService = LinkedInOAuthServiceFactory.getInstance().createLinkedInOAuthService(LINKEDIN_CONSUMER_KEY, LINKEDIN_CONSUMER_SECRET);
LinkedinDialog.factory = LinkedInApiClientFactory.newInstance(LINKEDIN_CONSUMER_KEY, LINKEDIN_CONSUMER_SECRET);
LinkedinDialog.liToken = LinkedinDialog.oAuthService.getOAuthRequestToken(OAUTH_CALLBACK_URL);
WebView mWebView = (WebView) findViewById(R.id.webkitWebView1);
mWebView.getSettings().setJavaScriptEnabled(true);
Log.i("LinkedinSample", LinkedinDialog.liToken.getAuthorizationUrl());
mWebView.loadUrl(LinkedinDialog.liToken.getAuthorizationUrl());
mWebView.setWebViewClient(new HelloWebViewClient());
mWebView.setPictureListener(new PictureListener()
{
public void onNewPicture(WebView view, Picture picture)
{
if(progressDialog != null && progressDialog.isShowing())
{
progressDialog.dismiss();
}
}
});
}
我收到以下错误
LinkedinDialog.liToken = LinkedinDialog.oAuthService.getOAuthRequestToken(OAUTH_CALLBACK_URL);
07-22 17:32:08.026: E/AndroidRuntime(26733): FATAL EXCEPTION: main
07-22 17:32:08.026: E/AndroidRuntime(26733): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.devicebee.app.transportfinder/com.devicebee.app.transportfinder.LinkedInActivity}: com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: https://api.linkedin.com/uas/oauth/requestToken
我搜索了互联网,根据一些帖子,这是因为我在一些代理下。但我很确定我没有任何代理。如果有人能告诉我该怎么做。此致