閱讀225 返回首頁    go 阿裏雲 go 技術社區[雲棲]


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"/> //固定不變




最後更新:2017-04-02 22:16:39

  上一篇:go android 異步圖片處理 工具類
  下一篇:go jQuery內置函數map和each的用法