Intent intent = new Intent();
ComponentName comp = new ComponentName("com.---.---", "com.---.---.activity.OtherActivity");
intent.setComponent(comp);
intent.putExtra("other", "true");
intent.setAction("android.intent.action.VIEW");
startActivity(intent);
需要其他app的activity支持被跳轉(zhuǎn)
<activity
android:name=".activity.OtherActivity"
android:exported="true"http://必須有這句話
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.VIEW" />//通過action跳轉(zhuǎn)
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>