I have application which has activity that shows product pages with long text descriptions in a TextView. In the description text I have links to other products that opens new instance of the same activity displaying the product. I am getting bug reports that I am unable to reproduce.
TextView has links like this:
<a href=\"android-app://com.package.name/http/appname/category/item/\">item</a>
In AndroidManifest.xml for the same activity where TextView is I have intent filter:
<intent-filter android:label="@string/filter_title">
<action android:name="android.intent.action.VIEW" />
<!-- Accepts URIs that begin with "http://appname/*/*/" -->
<data
android:host="appname"
android:pathPattern="/.*/.*/"
android:scheme="http" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
I set the TextView text like this:
tx.setText(Html.fromHtml(getResources().getString(id)));
tx.setMovementMethod(LinkMovementMethod.getInstance());
This works fine on all my test devices, however I am getting several bug reports in Developer Console:
android.content.ActivityNotFoundException: No Activity found to handle Intent
{ act=android.intent.action.VIEW
dat=android-app://com.package.name/http/appname/categoryname/itemname/ (has extras) }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1659)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1434)
...
Any ideas what could be causing the bugs?