I'm trying to install apk programmatically by this code:
Intent intent = new Intent(Intent.ACTION_VIEW);
String mimetype = "application/vnd.android.package-archive";
intent.setDataAndType(Uri.fromFile(file), mimetype);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
And it works fine for all devices except Samsung Galaxy Tab GT-P1000.
On Galaxy Tab package manager starts installation but never ending it. There is a progress bar endless showing. After closing pakage manager by back key, I make certain that never the less apk has been installed to the system.
If I try to install the same apk just by startting it in file manager all goes correctly. Apk installs and package manager installation progress finishes in few seconds.
So, what can I do to make package manager work correctly when installing programmatically?
The problem was in Galaxy Tab task manager specific. Due to bug in my app it was using 100% CPU. And it seems that task manager simply failed to switch on package manager. After I fixed a bug with 100% cpu, Package Manager begins working correctly.