Android start intent to view apk

前端 未结 2 1323
自闭症患者
自闭症患者 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);
    

提交回复
热议问题