This point has been used in recent projects and I have studied it.
1. Register scheme in the activity to be started. The Code is as follows:
<activity android:name=".main" android:label="@string/app_name"> <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="your_scheme" /> </intent-filter> </activity>
Note that both categories are indispensable, you know.
2. Call methods can be divided into two types:
1) Use HTML <a href = 'your _ scheme: // xxxxx'> </a> to start the android browser. The principle is the same as the following code.
2) start with intent. The Code is as follows:
Uri u = Uri.parse("your_scheme://XXXXXX");Intent i = new Intent(Intent.ACTION_VIEW , u);startActivity(i);
3. How to receive data in a started Program
Just as data is transmitted between activities.
Intent intent = getIntent(); Uri uri = intent.getData();
OK ~