Android start intent to view apk

前端 未结 2 1324
自闭症患者
自闭症患者 2021-01-31 06:23

In my application I am downloading and saving an apk to the SDcard and then I want to start the installation of the apk. I\'m using the following code to attempt this:



        
相关标签:
2条回答
  • 2021-01-31 07:11
    Intent intent =new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.parse(file), "application/vnd.android.package-archive");
    activity.startActivity(intent);
    
    0 讨论(0)
  • 2021-01-31 07:19

    Did you try using Uri.fromFile(new File(filePath)) instead of Uri.parse(file)?

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