So Far I searched in stackoverflow post and I can share the text directly to twitter without showing the popup dialog for share.That means when I click the button it is directly redirect to twitter app and shows the text.
My only issue is I have to share http image directly to twitter.
Below I have posted the code what I 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 that above code Text is showing correctly in twitter.But image is showing in http url.
Anyone know how to share the image directly to twitter app without showing link.
pic.twitter.com
domains. – Alveolate