According to the Internet, said the silent installation method, debugging, there NameNotFoundException error.
PackageManager pm = getPackageManager ();
try {
PackageInfo pi = pm.getPackageInfo (packageName,
PackageManager.GET_UNINSTALLED_PACKAGES);
if (pi! = null) {
installFlags | = PackageManager.INSTALL_REPLACE_EXISTING;
}
} Catch (NameNotFoundException e) {
}
I do not know where the problem occurs, please played heroes silent installation!
Reply:
Do not sink ah
PostsPackageInfo pi = pm.getPackageInfo (packageName,
PackageManager.GET_UNINSTALLED_PACKAGES);
Why is being given? packageName correct ah
Seeking answers
Reply:
Online wait, expert support
Reply:
No exception is thrown to go? This is what you want to achieve ah
Reply:
context.getPackageManager (). getPackageInfo (context.getPackageName (), 0) did not look to help you
Reply:
PackageManager.INSTALL_REPLACE_EXISTING this how I do not come out of it a little
Reply:
Reference article http://www.open-open.com/lib/view/open1328536451483.html
Which is being transformed over android.jar
Reply:
Do not know the android version of the problem, I run in android4.03, an exception is thrown NameNotFoundException
Reply:
I follow your code tried it, I have here is OK, then you definitely have a problem packagename
Reply:
Can look at your packagename is how to get it?
Reply:
Direct input packagename, no problem
Reply:
You are in the simulator experiments, or in the real machine? android version?
Reply:
On a real machine, version 2.3.3
Reply:
Phone system 4.0.1
Reply:
Posted about your manifest file look
Reply:
android: versionName = "1.0">
Reply:
I do not pass the test on a real machine 4.0.3
Reply:
Is solved? Where is the problem ah
No comments:
Post a Comment