I'm developing this app, for sending messages: the user inputs the text trough the app and by clicking Send the app launch the applications selector. Now I want to the user prefer: Whatsapp, fb messenger or sms. So I was looking for the way to show this apps first on the apps selector.
Is there any way to do it?
Thanks
// Intent
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "Mi texto a enviar");
intent.setType("text/plain");
// Check is there are apps to handle the intent
PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
boolean esIntentSeguro = activities.size() > 0;
// If is secure, launch intent
if (esIntentSeguro) {
startActivity(Intent.createChooser(intent,"Elige por donde enviarás el mensaje ..."));
}