標籤:android style blog color io ar div art sp
第一次在手機上安裝wsm tools時發現wsm只是個簡單的整合架構,需要用其中的工具還需要單獨安裝,而安裝一個工具以後發現表徵圖沒有顯示,感覺很神奇,最近工作需要,也要做android應用間的整合,研究了下,其實很簡單。只需要提供要被整合的應用package、activity名稱即可
例如,在當前應用中整合另外一個應用,像在同一應用中通過通過intent啟動:
1 public class MainActivity extends Activity { 2 @Override 3 protected void onCreate(Bundle savedInstanceState) { 4 super.onCreate(savedInstanceState); 5 setContentView(R.layout.main); 6 7 Intent intent = new Intent(); 8 //該應用的包名和要啟動的主Activity 9 ComponentName componentname = new ComponentName( "com.xxxx.xxxx", "com.xxxx.xxxx.App"); 10 intent.setComponent(componentname); 11 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 12 intent.putExtra("paramName", "paramValue");13 startActivity(intent);1415 } 16 }
如果想讓被整合的應用表徵圖隱藏,需要在AndroidManifest.xml中進行設定,修改的android.intent.category.LAUNCHER為android.intent.category.DEFAULT
即可實現表徵圖的隱藏:
<activity android:name=".MainActivity" android:process="com.baixd.framework" android:theme="@android:style/Theme.NoTitleBar" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <!--<category android:name="android.intent.category.LAUNCHER" />--> <category android:name="android.intent.category.DEFAULT" /> </intent-filter></activity>
Android 應用間的整合