0

我想将应用程序安装在应用程序内存而不是系统内存中的特定位置。我应该怎么办?

此代码将所选应用程序安装在我想要的手机内存中

            @Override
 protected void onListItemClick(ListView l, View v, int position, long id) {
    FileInformation information = files_list.get(position);
     Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setDataAndType(Uri.fromFile(new File(information.getPath())), 
             "application/" +
                        "vnd.android.package-archive");
        this.startActivity(intent);
 }
4

1 回答 1

0

SD卡的路径是:

String sdCardPath = Environment.getExternalStorageDirectory().toString() 
        + "/yourFolder"
        + "/yourFile.apk";

另外,对于安装应用程序:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(apkPath)),
                  "application/vnd.android.package-archive");
startActivity(intent);
于 2013-06-17T10:11:03.510 回答