1. http://stackoverflow.com/questions/2958701/launch-custom-android-application-from-android-browser
2. http://stackoverflow.com/questions/3038958/launch-app-with-url
有一点要注意:Main action: android.intent.action.MAIN,
这个主要的action比较特殊,即使你对他加了data, category也不起作用。像下面的例子中,
即使将Test action中的属性 data, category加到LunchApplicationFromBrowserActivity上也不会起作用的.
data: http://developer.android.com/guide/topics/manifest/data-element.html#mime
Adds a data specification to an intent filter. The specification can be just a data type (the mimeType
attribute), just a URI, or both a data type and a URI. A URI is specified by separate attributes for each of its parts:
scheme://host:port/path
orpathPrefix
or pathPattern
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lunch.application.browser"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".LunchApplicationFromBrowserActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Test"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<data android:scheme="https"></data>
<data android:scheme="lync"></data>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="Https" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
</application>
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lunch.application.browser"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".LunchApplicationFromBrowserActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Test"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<data android:scheme="https"></data>
<data android:scheme="lync"></data>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="Https" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
</application>
</manifest>