1.主的App调用子App的包这样写:
try { Intent intent = new Intent(Intent.ACTION_VIEW); String packageName = "com.wisesource.movablework.mvclient.android"; String className = "com.wisesource.movablework.mvclient.android.webview.ISWebViewActivity"; intent.setClassName(packageName, className); intent.putExtra("children", true); intent.putExtra("loadUrl", "file:///android_asset/www/config/register.html"); V8.startActivity(intent); } catch (Exception e) { Toast.makeText(V8, "未安装MVC", Toast.LENGTH_SHORT).show(); Log.e(TAG, "跳转到其他APP时: ",e ); }
2.子App隐藏图标这样写(加个Data):<activity android:name=".activity.WelcomeActivity" android:label="@string/app_name" android:theme="@style/Theme.AppStartLoad"> <intent-filter> <action android:name="android.intent.action.MAIN" /><data android:host="V8Activity" android:scheme="com.isrc.android.ui.test" /> </intent-filter> </activity>3.子App把允许别人调用的APP完全暴露出来:<activity android:name=".webview.ISWebViewActivity" android:alwaysRetainTaskState="true" android:exported="true" android:configChanges="orientation|keyboardHidden|screenSize|navigation" > </activity>