Android支持經過Url打開App,好比下面的Urlandroid
scheme://text/datastringmarkdown
要打開這樣的Url,首先在配置文件AndroidManifest.xml裏使用添加一種App打開的格式,代碼以下app
<?xml version="1.0″ encoding="utf-8″?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.test.demo" android:versionCode="1″ android:versionName="1.0″ > <uses-sdk android:minSdkVersion="9″ android:targetSdkVersion="17″ /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.sheng00.customuridemo.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <!– Open links like scheme://test/?… –> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="scheme」 android:host="test" /> </intent-filter> </activity> </application </manifest>
scheme但是是你定義的別的字符串,android:host能夠不寫,這樣就只能是經過android:scheme進度過濾定位
好比 test://xxxxx android:scheme=」test」這樣也能夠啓動你的程序ide