I installed an apk which was saved in directory of /data/data/package_name/files
with codes below:
Uri uri = Uri.fromFile(new File(apkSavingPath));
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri,"application/vnd.android.package-archive");
mContext.startActivity(intent);
I want it to return a resultcode to tell me whether the apk installed successfully or not, and I have tried method of startActivityForResult
, but it didn't work.
On method of onActivityResult
, it's resultCode is always 0(zero)
whether apk installed successfully or not. Can I get such a resultcode?