相关疑难解决方法(0)

在android中添加图像文件的完全权限.

我使用以下代码为android中的图像文件添加完整权限.此代码不是每次都有效.想象一下有三个图像文件,A.png,B.png和C.png.在某些情况下,所有文件都将获得完全权限.在某些情况下,A.png将获得并在某些条件下获得或A和B将获得完全许可.我找不到原因.请帮我找原因.

String iconFile = themePrefs.getString(info.activityInfo.name, ""); // Icon file = "/data/data/com.android.settings/MyApp/A.png";
System.out.println("FileExecute " + ico.canExecute());     //always false
System.out.println("FileRead " + ico.canRead());           //always false
System.out.println("FileWrite " + ico.canWrite());         //always false
System.out.println("FileExists " + ico.exists());          //always true
System.out.println("FileisFile " + ico.isFile());          //always true
System.out.println("FileisDirectory " + ico.isDirectory());//always false

Drawable d = null;
FileInputStream fis; // in stream
try {
    File ico = new File(iconFile); //creating a file with the path (because only this is working with absolute path)
    try {
         Runtime.getRuntime().exec("chmod 777 …
Run Code Online (Sandbox Code Playgroud)

android file

0
推荐指数
1
解决办法
2612
查看次数

标签 统计

android ×1

file ×1