开发者

[File Export]No such file or directory

开发者 https://www.devze.com 2023-02-23 09:54 出处:网络
I want to export a file to SDCARD, i have however this log message: 04-11 18:34:22.383: DEBUG/Carburant(5734): /mnt/sdcard/Carburant/alaa.peugeot.settings.dat (Is a directory)

I want to export a file to SDCARD, i have however this log message:

04-11 18:34:22.383: DEBUG/Carburant(5734): /mnt/sdcard/Carburant/alaa.peugeot.settings.dat (Is a directory)

I want to have alaa.peugeot.settings.dat not as a directory, but as a file. Here is my code:

try{
            final SharedPreferences preferences = PreferenceManager
            .getDefaultSharedPreferences(context);
    String fileName = context.getResources().getString(R.string.fileName);
    String fileDir = "" + preferences.getString("login", "") + "."+ preferences.getString("marque", "") + ".";

            File dir = new File (sdCard.getAbsolutePath() + "/Ca开发者_如何学Gorburant");
            dir.mkdirs();
            File file = new File(dir, fileDir+fileName);
            OutputStream out = new FileOutputStream(file);
            File f1 = new File(context.getFilesDir(), fileDir+fileName);
            InputStream in = new FileInputStream(f1);

What going on with the code? Thank you very much.

0

精彩评论

暂无评论...
验证码 换一张
取 消