During the development process, we often encounter the problem of starting another apk application in an application. The core point is that we need to get the package name and class name of the third-party apk, for example: the package name is com. funcity. taxi. passenger, class name is com. funcity. taxi. passenger. activity. loadActivity. Starting from an apk to another apk is also done by sending intent. The event response procedure for clicking the corresponding button is as follows:
Intent mIntent = new Intent (); mIntent. addFlags (Intent. FLAG_ACTIVITY_NEW_TASK); ComponentName comp = new ComponentName ("com. funcity. taxi. passenger "," com. funcity. taxi. passenger. activity. loadActivity "); mIntent. setComponent (comp); mIntent. setAction ("android. intent. action. VIEW "); startActivity (mIntent );
Click the response button to start another apk.