1

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?

Oto Zars
  • 623
  • 10
  • 17
  • Where is the intent code that opens another activity to show other products from the description link? it looks like your intent is expecting extras – Want2bExpert Aug 20 '15 at 17:12
  • There is no "intent code", the TextView handles links automatically. – Oto Zars Aug 21 '15 at 09:46
  • This might help http://stackoverflow.com/questions/11413399/open-textview-links-at-another-activity-not-default-browser – Want2bExpert Aug 21 '15 at 10:48
  • These Links might help http://stackoverflow.com/questions/11413399/open-textview-links-at-another-activity-not-default-browser http://stackoverflow.com/questions/1697084/handle-textview-link-click-in-my-android-app – Want2bExpert Aug 21 '15 at 10:51

0 Answers0