美文网首页
跳转到其他APP的非主Activity

跳转到其他APP的非主Activity

作者: wslerz | 来源:发表于2016-09-07 10:25 被阅读0次
            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支持被跳转

<activity
android:name=".activity.OtherActivity"
android:exported="true"//必须有这句话
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.VIEW" />//通过action跳转
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

相关文章

网友评论

      本文标题:跳转到其他APP的非主Activity

      本文链接:https://www.haomeiwen.com/subject/tzdjettx.html