Android can open another app in an app.

Source: Internet
Author: User

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 !!!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.