Skip to content

Repository files navigation

ShareTextViaMultiApp

only text

  • MainActivity.java
findViewById(R.id.btn).setOnClickListener(newView.OnClickListener() {
@OverridepublicvoidonClick(Viewv) {
Intentintent = newIntent(Intent.ACTION_SEND_MULTIPLE);
intent.setData(Uri.parse("mailto:"));
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "The text you wanted to share");
try {
startActivity(intent);
} catch (android.content.ActivityNotFoundExceptionex) {
Toast.makeText(MainActivity.this, "Whatsapp have not been installed.", Toast.LENGTH_SHORT).show();
}
}
});

Copyright 2021 M. Fadli Zein

About

only text

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages