代码如下:

 public static void LauchInstall(String FilePathName, Context context)
        {
                chmod("777", FilePathName);
                Intent intent = new Intent(Intent.ACTION_VIEW);  
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                intent.setDataAndType(Uri.fromFile(new File(FilePathName)), "application/vnd.android.package-archive");  
                context.startActivity(intent);                   
        }
        
        //修改apk权限
        public static void chmod(String permission, String path)
        {
                try
                        {
                                String command         = "chmod " + permission + " " + path;
                                Runtime runtime = Runtime.getRuntime();
                                runtime.exec(command);
                        }
                        catch (IOException e)
                        {
                                e.printStackTrace();
                        }
        }

参考地址:http://www.devdiv.com/thread-72452-1-1.html

相关文章:

  • 2021-04-10
  • 2022-12-23
  • 2021-06-05
  • 2021-12-06
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2021-09-19
猜你喜欢
  • 2022-01-06
  • 2022-02-05
  • 2021-05-22
  • 2022-12-23
  • 2021-04-16
  • 2021-07-30
相关资源
相似解决方案