当前位置: 代码迷 >> 综合 >> android 启动另一个apk中acitity的方法
  详细解决方案

android 启动另一个apk中acitity的方法

热度:89   发布时间:2024-01-21 16:13:29.0

1.如果都是自己的acitvity那就好办了

被调用的activity

<activity android:name="com.su.appguardservice.StartSevActivity" ><intent-filter><action android:name="com.su.appguardservice.STARTSEVACTIVITY" /><category android:name="android.intent.category.DEFAULT" /></intent-filter></activity>

调用者:

Intent intent = new Intent("com.su.appguardservice.STARTSEVACTIVITY");startActivity(intent);

android系统的很多界面都是这么调出的 


2.如果不是调用自己的activity

那可能需要反编译一下他的清单文件了

 a如果他的也设置了action 直接调用就可以

 b 如果没有


Intent intent = new Intent();
intent.setComponent(new ComponentName("com.android.test", "com.android.test.HelloAndroid"));
startActivity(intent);




  相关解决方案