Note that there are some explanatory texts on larger screens.

plurals
  1. POintent filter for ical URLs
    text
    copied!<p>I'm trying to register my Android app as a handler for iCal URLs. To do this I set intent filters in my Manifest for the <code>webcal://</code> pseudo protocol and for HTTP URLs using the <code>text/calendar</code> MIME type (see below).</p> <p>This works perfectly fine in the emulator, but on a real device I'm having problems. The <code>webcal://</code> filter works, but the <code>text/calendar</code> one doesn't. Instead the Browser displays the ical file as plain text instead of passing the URL to my app.</p> <p>I checked that the browser isn't configured as a default handler for ical (in Settings->Applications->Browser) and I asked a few other people if they could reproduce the problem on their mobiles. All with the same result.</p> <p>What's the correct way to register for text/calendar URLs?</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.splitbrain.giraffe" android:versionName="0.31" android:versionCode="4"&gt; &lt;uses-sdk android:minSdkVersion="4" /&gt; &lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.Light.NoTitleBar"&gt; &lt;activity android:label="@string/app_name" android:name="MainActivity"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;intent-filter&gt; &lt;category android:name="android.intent.category.BROWSABLE"&gt;&lt;/category&gt; &lt;action android:name="android.intent.action.VIEW"&gt;&lt;/action&gt; &lt;data android:mimeType="text/calendar" android:scheme="http"&gt;&lt;/data&gt; &lt;category android:name="android.intent.category.DEFAULT"&gt;&lt;/category&gt; &lt;/intent-filter&gt; &lt;intent-filter&gt; &lt;category android:name="android.intent.category.BROWSABLE"&gt;&lt;/category&gt; &lt;action android:name="android.intent.action.VIEW"&gt;&lt;/action&gt; &lt;data android:scheme="webcal"&gt;&lt;/data&gt; &lt;category android:name="android.intent.category.DEFAULT"&gt;&lt;/category&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="OptionsActivity"&gt;&lt;/activity&gt; &lt;activity android:name="DetailActivity"&gt;&lt;/activity&gt; &lt;activity android:name="AboutActivity"&gt;&lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p><strong>Update:</strong> Turns out the above works fine in the Android 1.6 emulator, but not on a 2.3.3 emulator where it shows the same behavior as on my phone. Is this a bug in Android maybe?</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