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.