I am new to android I am working in an android application that share twitter tweets from android application and I am getting an error retrieveRequestToken raises “Communication with the service provider failed: null”. I got a solution for this from stack over flow(http://stackoverflow.com/questions/8534831/method-retrieverequesttoken-raises-communication-with-the-service-provider-fail). It says that we will be able to solve this problem by StrictMode . I don't know how to apply this.
Here is ma code :
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+"");
}
Please help me. Thanks in advance.