ProjectOne:
的AndroidManifest.xml:
<activity
android:name=".ProjectTwoActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.zetsin.test.MYACTION" />
<data android:scheme="info"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
和MainActivityInProjectOne.java
// getIntent().getData() is get the url form ProjectTwo
if (getIntent().getData() != null) {
// get the data passed from ProjectTwo
String value = getIntent().getExtras().getString("value");
}
ProjectTwo:
MainActivityInProjectTwo.java
// start the activity in ProjectOne by Action and URI, then pass the data.
Uri uri = Uri.parse("info://test");
Intent invokeIntent = new Intent("com.zetsin.test.MYACTION",uri);
invokeIntent.putExtra("value", "Data from project Two");
startActivity(invokeIntent);
如果我使用上面的代碼項目一個不推出,如果你不介意的話,你可以請我更新indetail –
發表您的主代碼這裏?? – zetsin