app1 跳转方:
在跳转函数中执行:
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.junrui.yhtd","com.junrui.yhtd.ui.record.MedicalRecordActivity")); //第一个参数为app2的包名,第二个参数为app2的被调转界面activity
intent.putExtra("recordId","7398");//携带参数
intent.setAction("MedicalRecordDetail"); //app2中被调转界面的action
startActivity(intent);
app2 被跳转方:
在mainfest文件中配置被调转界面
主要是添加action属性,用来过滤。
<activity
android:name="com.junrui.yhtd.ui.record.MedicalRecordActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar"
android:windowSoftInputMode="adjustResize|stateHidden">
<intent-filter>
<action android:name="MedicalRecordDetail"/>
</intent-filter>
</activity>