I am trying to get a list of all applications capable of sending text messages.
I found several solutions that suggest using PackageManager.
I think the intention to be used is ACTION_SEND, but when I run my code, I always get an empty list.
This is my code:
Intent mainIntent = new Intent(Intent.ACTION_SEND, null); List<ResolveInfo> pkgAppsList = getApplicationContext().getPackageManager().queryIntentActivities( mainIntent, PackageManager.GET_RESOLVED_FILTER); int size = pkgAppsList.size(); int i = 0; Log.i(TAG, "Size: " + size); for(ResolveInfo infos : pkgAppsList){ String name = infos.activityInfo.applicationInfo.loadLabel(getPackageManager()).toString(); Log.i(TAG, "name: " + name); }
Any idea?
java android
Ivan
source share