ACTION_INSTALL_PACKAGE

前端 未结 1 679
闹比i
闹比i 2020-12-29 12:56

My app is trying to install an APK.

Intent installIntent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
installIntent.setData(Uri.fromFile(new File(pathToApk))         


        
相关标签:
1条回答
  • 2020-12-29 13:23

    Found the culprit.

    *installIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);*

    Though the system brings the existing instance of my activity back to life it is in the new TASK stack. So the system cancels the activityForResult before it starts the new TASK.

    Thank you

    0 讨论(0)
提交回复
热议问题