Late answer, but for future readers: if you support a minimum API level of 15 , then there is a more direct (less hacky) way to return to the browser for URLs that you understand do not want to process without resorting to disabling / re-enabling components for URL search.
nbarraille's answer is creative and perhaps the only option if you need to support APIs below 15, but if you don't, you can use Intent.makeMainSelectorActivity() to launch the user's default browser, which allows you to bypass the Android app selection dialog ResolverActivity .
Do not do this
So instead of re-broadcasting the Intent URL, the typical way is:
Do it
Instead, you broadcast this intention:
Intent defaultBrowser = Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, Intent.CATEGORY_APP_BROWSER); defaultBrowser.setData(data); startActivity(defaultBrowser);
This will allow Android to load the browser application and data URL. This should bypass the selection dialog, even if they have more than one browser application installed. And without the dialogue of choice, you donβt need to worry about the fact that the application falls into an endless cycle of interception / re-broadcasting of the same intention.
Caveat
You should be fine by opening the URL (the one you don't want to handle) in a custom browser. If you want other applications other than a browser to be able to open a link, this solution will not work, because there is no selection dialog.
Trap
As far as I can tell, the only quirk from using this solution is that when a user clicks one of your deep links, they can choose to open in their application or in their browser, etc. When they select your application and your internal application logic implements a URL that it does not want to intercept, the user is immediately shown a browser. Therefore, they select your application, but a browser is displayed instead.
NOTE. When I say "broadcast" in this answer, I mean the general term, not the actual Android system.