Android can open another app in an app.
First, obtain the package name:
Use aapt // aapt is a tool that comes with the sdk. It is stored in the sdk \ builds-tools \ directory.
For example, switch the command line to the aapt.exe directory and run: aapt dump badging E: \ Android \ weixin531android460.apk.
2. The running result is as follows (only part of the screenshot is taken ):
package: name='com.tencent.mm' versionCode='542' versionName='6.1.0.105_r1085424'uses-permission:'com.tencent.mm.plugin.permission.READ'uses-permission:'com.tencent.mm.plugin.permission.WRITE'uses-permission:'com.tencent.mm.plugin.permission.SEND'uses-permission:'com.tencent.mm.permission.MM_MESSAGE'sdkVersion:'10'targetSdkVersion:'16'
We can see a lot of information, including the package name. The package name is com. tencent. mm.
Then start the Code:
try { PackageManager packageManager = getPackageManager(); Intent intent=new Intent(); intent = packageManager.getLaunchIntentForPackage("com.tencent.mm"); startActivity(intent); } catch (Exception e) { e.printStackTrace(); Intent viewIntent = new Intent("android.intent.action.VIEW",Uri.parse("http://weixin.qq.com/")); startActivity(viewIntent); }
If the mobile phone is installed, open the main interface. If not installed, open a browser to download it !!!