I found a note in the Send Binary Content
<https://developer.android.com/training/sharing/send.html#send-binary-content>,says:
**You can use a MIME type of "\*/*", but this will only match activities
that are able to handle generic data streams.**
Does this means i will get less match result if I use \*/* instead of a
specific one like text/plain ? But I have write codes which turns out not.
here is my code:
private void textIntent() {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.setType("*/*");
// sendIntent.setType("text/plain");
Uri uriToImage =
Uri.parse("https://developer.android.com/training/sharing/send.html");
sendIntent.putExtra(Intent.EXTRA_STREAM, uriToImage);
PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities =
packageManager.queryIntentActivities(sendIntent,
PackageManager.GET_RESOLVED_FILTER);
Log.i("Log", "size: " + activities.size());
for (ResolveInfo info : activities) {
Log.i("Log", "info: " + info.toString());
IntentFilter filter = info.filter;
if (filter == null) {
Log.i("Log", "filter is null");
continue;
}
printIterator("action", filter.actionsIterator());
printIterator("category", filter.categoriesIterator());
printIterator("type", filter.typesIterator());
printIterator("schemes", filter.schemesIterator());
}
Intent chooser = Intent.createChooser(sendIntent, "title");
startActivity(chooser);
}
private void printIterator(String type, Iterator<String> it) {
if (it == null) {
Log.i("Log", "no " + type);
return;
}
while (it.hasNext()) {
Log.i("Log", type + " : " + it.next());
}
}
So my question is : What does **You can use a MIME type of "\*/*", but
this will only match activities that are able to handle generic data
streams.** means ?
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/e34fd191-df3f-4a5e-adbb-0c6f07b9df10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.