我是android新手我正在從android應用程序共享twitter鳴叫的android應用程序中工作,並且出現錯誤retrieveRequestToken引發「與服務提供者的通信失敗:null」。我從棧溢出流得到了這個解決方案(http://stackoverflow.com/questions/8534831/method-retrieverequesttoken-raises-communication-with-the-service-provider-fail)。它說我們將能夠通過StrictMode解決這個問題。我不知道如何應用這個。如何在android中應用StrictMode
這裏是馬代碼:
try {
Log.i(TAG, "Retrieving request token from Google servers");
final String url = provider.retrieveRequestToken(consumer,Constants.OAUTH_CALLBACK_URL);
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url))
.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP
| Intent.FLAG_ACTIVITY_NO_HISTORY
| Intent.FLAG_FROM_BACKGROUND);
context.startActivity(intent);
} catch (Exception e) {
Log.e("Error",e+"");
}
請幫助我。 在此先感謝。