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