天天看点

android 跨应用跳转 启动其他应用指定界面

//应用 a  跳转到应用b指定界面

//应用a调转的intent代码

 intent intent = new intent();

        componentname comp = new componentname("com.xxx.xxxx", "com.xxx.xxx.bactivity");

        intent.setcomponent(comp);

        intent.putextra("other", "true");

        intent.setaction("android.intent.action.view");

        startactivity(intent);

//其中  "com.xxx.xxxx",要跳转到的b应用的包名    

//   "com.xxx.xxx.bactivity"   b应用的详细路径  

//  自定义传一个参数,区别b一个用内部应用跳转   

//  应用b需要在mainifest.xml注册 代码

<activity

            android:configchanges="orientation|keyboardhidden"

            android:name=".activity.bactivity" >

            <intent-filter >

                <action android:name="android.intent.action.view"/>

                <category android:name="android.intent.category.default"/>

            </intent-filter>

        </activity><!-- 分类详细列表 -->

//  其中主要是     <action android:name="android.intent.action.view"/> //固定不变

 //  <category android:name="android.intent.category.default"/> //固定不变

继续阅读