My app can open links by default using this:
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="example.com"
android:scheme="http" />
<data
android:host="www.example.com"
android:scheme="http" />
....
Now, I have a link in my app that I do not support (yet). So what I am doing in the meanwhile is open it with an external browser. like this:
String requestURL = "www.example.com/unsupportedlink";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(requestURL));
mActivity.startActivity(i);
What I expect is that it will be open on the browser, but if the user chose that all links will be opened by app by default ("Allways open" and not "Just Once"), the app is called again and sends the link to the browser again - it causes infinite loop. How can I avoid this?