"A problem occurred while parsing the software package" when calling the system to install software"

Source: Internet
Author: User

 

As follows:CodeWhen you call the system to install the APK software, the system prompts "An error occurred while parsing the software package"

Debugging HTC tattoo G4 android1.6 on a real machine

Prerequisite: the path and file are absolutely correct.

String filepath = environment. getexternalstoragedirectory () + "newmopclient.apk"; <br/> file = new file ("file: //" + filepath); <br/> uri data = Uri. fromfile (File); <br/> intent = new intent (intent. action_view); <br/> intent. setdataandtype (data, "application/vnd. android. package-Archive "); <br/> startactivity (intent );

The above method is also released on the Internet to call the system to install software.

After repeated attempts, the solution is as follows:

Intent intent = new intent (); <br/> intent. setdataandtype (URI. parse ("file: // sdcard/newmopclient.apk"), "application/vnd. android. package-Archive "); <br/> startactivity (intent );

This may be related to models and Android versions,

In short, try both methods when the above errors occur.


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.