So far, I searched in the postoffflow post, and I can share the text directly with twitter without showing a popup dialog for share.That means that when I click the button, it is redirected directly to the Twitter application and shows the text.
My only problem is that I need to transfer the http image directly to twitter.
Below I posted the code I have tried so far:
UsersAdapter.java:
// Create intent using ACTION_VIEW and a normal Twitter url: String tweetUrl = String.format("https://twitter.com/intent/tweet?text=%s&url=%s", urlEncode(strShareText), urlEncode(strShareImageUrl)); Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(tweetUrl)); // Narrow down to official Twitter app, if available: List<ResolveInfo> matches = context.getPackageManager().queryIntentActivities(intent, 0); for (ResolveInfo info : matches) { if (info.activityInfo.packageName.toLowerCase().startsWith("com.twitter")) { intent.setPackage(info.activityInfo.packageName); } } context.startActivity(intent);
In this code above, the text is displayed correctly on twitter. But the image is displayed in http-url.
Does anyone know how to transfer the image directly to the Twitter application without showing the link.
source share