Implicit Intents
When using implicit intents, we have to check at least one app has to be there in the device to handle the intent. The way to check the sendIntent is,
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage);
sendIntent.setType(HTTP.PLAIN_TEXT_TYPE); // "text/plain" MIME type
startActivity(sendIntent);
if (sendIntent.resolveActivity(getPackageManager()) != null) {
startActivity(sendIntent);
}
Comments
Post a Comment