小编tot*_*oto的帖子

Android Studio - 更改默认代码样式

我习惯以这样的方式编写代码:

private String blabla()
{
    return "bla";
}
Run Code Online (Sandbox Code Playgroud)

但Android Studio已针对此代码进行了调整:

private String blabla() {
    return "bla";
    }
Run Code Online (Sandbox Code Playgroud)

问题:如何为我更改此选项?

java android android-studio

5
推荐指数
1
解决办法
4577
查看次数

Java - FileNotFoundException: /mnt/sdcard: open failed: EISDIR (Is a directory)

我正在尝试从 sd 卡解压缩 Android 设备上的 RAR 存档,但出现错误:

 java.io.FileNotFoundException: /mnt/sdcard: open failed: EISDIR (Is a directory)
Run Code Online (Sandbox Code Playgroud)

我选择了一个 rar 文件并尝试在我的 SD 卡中解压缩它。错误说它不是目录,但它是。我不知道如何修复它。

我的代码:

public static void unrar(File srcRarFile, String destPath, String password) throws IOException {
    if (null == srcRarFile || !srcRarFile.exists()) {
        throw new IOException(".");
    }
    if (!destPath.endsWith(SEPARATOR)) {
        destPath += SEPARATOR;
    }
    Archive archive = null;
    OutputStream unOut = null;
    try {
        archive = new Archive(srcRarFile, password, false);
        FileHeader fileHeader = archive.nextFileHeader();

        while(null != fileHeader) {
            if (!fileHeader.isDirectory())
            {
                // 1 …
Run Code Online (Sandbox Code Playgroud)

java android

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

标签 统计

android ×2

java ×2

android-studio ×1