i want to share a huge text via Intent.ACTION_SEND; but it's just send a piece of my text... :|
this is my code
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, txt_Main.getText().toString());
startActivity(Intent.createChooser(intent, "Share via ..."));
thank you
Related
I need to send mail with html content.Html content is coming from back end .I have tried using Html.fromHtml and passed it to Intent.EXTRA_TEXT but I am not getting the desired result my html content contains images and hyperlink but after using Html.fromHtml i am getting text only
Intent intent = new Intent(Intent.ACTION_SEND);
String[] recipients = {"wantedEmail#gmail.com"};
intent.putExtra(Intent.EXTRA_EMAIL, recipients);
intent.putExtra(Intent.EXTRA_SUBJECT, "emailTitle:");
intent.putExtra(Intent.EXTRA_TEXT,Html.fromHtml(emailContent));
intent.setType("text/html");
intent.putExtra(Intent.EXTRA_CC, "ghi");
intent.setType("message/rfc822");
startActivity(Intent.createChooser(intent, "Send mail"));
intent.putExtra(Intent.EXTRA_TEXT, emailContent);
Putting that you should be able to get what you see
I want to share multiple images with a single text on Whatsapp.
I am using this code
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND_MULTIPLE);
intent.putExtra(Intent.EXTRA_TEXT, "Text caption message!!");
intent.putExtra(Intent.EXTRA_HTML_TEXT, "<html>Text caption message!!");
intent.setType("text/plain");
intent.setType("image/jpeg");
intent.setPackage("com.whatsapp");
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, files);
startActivity(intent);
This code is working fine but the problem is that the text is coming on every image. I want the text to be placed on only one image. Is there any way I can do that? TIA
I'm trying to make refer and earn activity in my appSo I want to permanently display a few apps like whatsapp, etc for the user to click on them and share directly.I'm using Intent to share the referral code but it pops up the apps list when the user clicks share.The code I'm using is,
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "This is a message");
intent.setType("text/plain");
startActivity(Intent.createChooser(intent, "Share via"));
How can I make the app chooser permanent for a few apps?
The app chooser is not intended to be displayed permanently. Therefore you will have to create simple buttons or icons and create an intent that refers to the desired app directly, by setting the package of the intent.
E.g. to share sth with WhatsApp use sth like this:
Intent sendIntent = new Intent();
// here comes the magic
sendIntent.setPackage("com.whatsapp");
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);
Depending on the type of content you want to share and the apps you want to share with, it makes sense to reuse the code to create the intent and just set the respective package and eventually some additional parameters.
You will need package name of app and a Intent.
change ACTION_VIEW to ACTION_SENDTO
set the Uri as you did set the
package to whatsapp
Intent i = new Intent(Intent.ACTION_SENDTO,
Uri.parse("content://com.android.contacts/data/" + c.getString(0)));
i.setType("text/plain");
i.setPackage("com.whatsapp"); // so that only Whatsapp reacts and not the chooser
i.putExtra(Intent.EXTRA_SUBJECT, "Subject");
i.putExtra(Intent.EXTRA_TEXT, "I'm the body.");
startActivity(i);
You can refer this link for More:
Send text to specific contact (whatsapp)
Sending message through WhatsApp
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("*/*");
intent.setPackage("com.whatsapp");
intent.putExtra(Intent.EXTRA_TEXT, "your text content");
startActivity(intent)
I am facing same problem for share tamil font content in Whatsapp. I found the solution, this setType("*/*") share full content.
I am trying to share text and attachment using ACTION_SEND.
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"email"});
intent.putExtra(Intent.EXTRA_SUBJECT, "subject");
intent.putExtra(Intent.EXTRA_TEXT, "body");
Uri uri = Uri.fromFile(file);
intent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(intent, "Send..."));
However, in the list appear applications like Hangouts which do not accept attachments.
Can I filter out application which do not accept attachments? Is there a tag or another indicator which can tell me if application accepts attachments or not?
intent.setType("message/rfc822");
Use this.
In my android, how can I launch android's compose email activity with an attachment attached?
Just launch an intent with the following structure:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/html");
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"to#example.com"});
intent.putExtra(Intent.EXTRA_SUBJECT, "the subject");
intent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml("the content"));
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/file.ext"));
startActivity(intent);
Notice that I'm using the complete path to the file: "file:///sdcard/file.ext". Also, take into account that you can share files that you have saved into the SDCard only (otherwise, the email client will ignore the file).