Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating an IntentFilter to match a URL with no scheme or host
    text
    copied!<p>I have an activity defined thus:</p> <pre><code>[Activity (Label = "MyActivity")] [IntentFilter (new[]{Intent.ActionView}, Categories=new[]{Intent.CategoryDefault, Intent.CategoryBrowsable}, DataScheme="")] public class MyActivity : Activity {} </code></pre> <p>or for the non-monodroid folk:</p> <pre><code>&lt;activity android:label="MyActivity" android:name="com.myapp.android.MyActivity"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.VIEW" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;category android:name="android.intent.category.BROWSABLE" /&gt; &lt;data android:scheme="" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>It contains a text view, which I populate with HTML thus:</p> <pre><code>Android.Text.ISpanned spannedContent = Html.FromHtml (someHTML); textView.SetText (spannedContent, TextView.BufferType.Spannable); </code></pre> <p>The links show up as clickable, so far so good. However, the content of my links are like:</p> <pre><code>Here is a link to: &lt;a href="/blah"&gt;blah&lt;a&gt; </code></pre> <p>I can't figure out how to match the resulting Intent resolution to my activity. I've tried a few combinations of DataScheme/DataHost/DataPath and with/without Categories. Modifying the url to be like:</p> <pre><code>&lt;a href="customScheme://blah"&gt;blah&lt;/a&gt; </code></pre> <p>and setting the corresponding scheme in the intent filter DOES work, but I'd prefer not to be in the business of modifying the incoming html.</p> <p>Any chance of matching that without having to modify the html itself?</p> <p> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload