Adding static intent filter definitions after installation

I have a feeling that this is simply impossible, but I thought we would get confirmation ...

I would like to have an application that responds to specific HTTP URLs, and I know that I can predefine multiple entries in the manifest like this:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="http" android:host="example.com" />
</intent-filter>

However, I would like the user to add (or potentially delete) hosts, for example. add "http://example.net" or deactivate the predefined entry "http://example.com/".

Of course, I can capture such intentions by registering a dynamic broadcast receiver in the foreground.

But is it possible to register new intent filters with the system after installation so that my application does not have to be in the foreground to capture intentions that correspond to the newly added host names?

+5
source share
1 answer

Good question.

Not sure if this is possible, but I would:

a) Check what happens when you register the receiver using the registerReceiver()inside method Context. Perhaps it is somehow preserved.

b) Install a dynamic broadcast receiver inside the infinite Service. (Yes, this is ugly, I know)

+1
source

All Articles