Note that there are some explanatory texts on larger screens.

plurals
  1. POIntent Filter to Launch My Activity when custom URI is clicked
    text
    copied!<p>I am trying to allow a URI to be registered to open up with my app. Like the <code>PatternRepository</code> on the Blackberry and the <code>CFBundleURLName</code>/<code>CFBundleURLSchemes</code> on the iPhone. How do I achieve the same results on the Android?</p> <p>The system will be sending emails with the following link: <code>myapp://myapp.mycompany.com/index/customerId/12345</code>. The idea is that the user should be able to click on the link to open up the customer activity in the application. </p> <p>I've tried numerous suggestions from other SO posts but I cannot get the OS to recognize the pattern and open my app. </p> <p>On The Gmail app it looks like this: myapp://<a href="http://myapp.mycompany.com/index/customerId/12345" rel="nofollow noreferrer">myapp.mycompany.com/index/customerId/12345</a>. It recognizes and underlines the <code>myapp.mycompany.com/index/customerId/12345</code> portion of the link and it opens it in a browser. The <code>myapp://</code> part is not <em>linkified</em>. </p> <p>The standard mail application treats the entire link as plain text.</p> <p>What am I missing here?</p> <p>PS: I've already looked at <a href="https://stackoverflow.com/questions/2448213/how-to-implement-my-very-own-uri-schema-on-android">How to implement my very own URI scheme on Android</a> and <a href="https://stackoverflow.com/questions/2430045/how-to-register-some-url-namespace-myapp-app-start-for-accessing-your-progra/2430468#2430468">How to register some URL namespace (myapp://app.start/) for accessing your program by calling a URL in browser in Android OS?</a></p> <p><strong>The Manifest:</strong> </p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="0.0.8" package="com.mycompany.myapp.client.android"&gt; &lt;uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7"/&gt; &lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt; &lt;uses-permission android:name="android.permission.READ_PHONE_STATE"/&gt; &lt;application android:label="@string/app_name" android:name="myappApplication" android:icon="@drawable/ic_icon_myapp" android:debuggable="true"&gt; &lt;activity android:label="My App" android:name=".gui.activity.LoginActivity" label="@string/app_name"&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;/activity&gt; &lt;activity android:name=".gui.activity.CustomerDetailActivity" &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="myapp"/&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".gui.activity.CustomerDetailActivity"/&gt; &lt;activity android:name=".gui.activity.CustomerImageViewerActivity" /&gt; &lt;activity android:name=".gui.activity.CustomerListActivity" android:configChanges="orientation|keyboardHidden"/&gt; &lt;activity android:name=".gui.activity.HomeActivity" android:configChanges="orientation|keyboardHidden"/&gt; &lt;activity android:name=".gui.activity.AboutActivity" android:configChanges="orientation|keyboardHidden"/&gt; &lt;activity android:name=".gui.activity.AccountActivity" android:configChanges="orientation|keyboardHidden" /&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre>
 

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