Reputation: 626
I would like to know if I can make share content without permit user change the text.
For example:
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);
Where the user can't change 'this is my text to send.' and can't add or remove text too. It's possible?
Upvotes: 0
Views: 65
Reputation: 48871
It's possible?
No, not using the code that you show.
Using startActivity(...)
with an Intent
which uses ACTION_SEND
will simply cause the OS to find an external (3rd party) app able to send data of the type you are passing to it. Once the app has been started, it will act in exactly the same way as it would if the user had launched it manually.
The only way you can do what you want is if you write your own code to send the text using whatever protocol you want to send it (SMTP, SMS, HTTP etc).
Upvotes: 4