I set my app up to receive share intents with these intent filters and this handler. I don't see it in the share menu.
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="https"/>
</intent-filter>
Intent intent = getIntent();
String action = intent.getAction();
String type = intent.getType();
if (Intent.ACTION_SEND.equals(action) && type.equals("text/plain")) {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle(R.string.pick_profile);
builder.setItems(getConnProfNames(connectionProfiles), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
selectedItem = connectionProfiles.get(which);
DownloadTask.execute();
}
});
}
There's no such thing as a share Intent. Apps can share data using Intents with different actions, types, extras and data. Mostly these apps will use ACTION_SEND but depending on the app the other parameters will vary widely. With your intent-filter you only catch Intents using http and https schemes nothing else and your code does restrict the type additionally to text/plain. It all depends what the "share menu" does when triggered, whether your code above works or not.
What intents the Dolphin browser uses to share its data is AFAIK not documented publicly. I managed to "catch" one of its Intents using the following filter:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
I also managed to grab the URL from the extras like so:
CharSequence text = intent.getCharSequenceExtra(Intent.EXTRA_TEXT);
It really depends on what you are trying to achieve what filter you need. If you are trying to grab the URL and load the HTML page then the filter I used will do the job. It allows to get the URL and you can then show the page e.g. in a WebView.