日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Android >内容正文

Android

android手机内存创建文件夹,Android在内存问题中创建文件夹

發布時間:2024/1/1 Android 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android手机内存创建文件夹,Android在内存问题中创建文件夹 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我在內部存儲器中為我的應用程序創建文件夾時遇到了一些問題.我正在使用這段代碼:

public static void createFoldersInInternalStorage(Context context){

try {

File usersFolder = context.getDir("users", Context.MODE_PRIVATE);

File fileWithinMyDir = new File(usersFolder, "users.txt"); //Getting a file within the dir.

FileOutputStream out = new FileOutputStream(fileWithinMyDir); //Use the stream as usual to write into the file.

File dataFolder = context.getDir("data", Context.MODE_PRIVATE);

File fileWithinMyDir2 = new File(dataFolder, "data.txt"); //Getting a file within the dir.

FileOutputStream out2 = new FileOutputStream(fileWithinMyDir2); //Use the stream as usual to write into the file.

File publicFolder = context.getDir("public", Context.MODE_PRIVATE);

File fileWithinMyDir3 = new File(publicFolder, "public.txt"); //Getting a file within the dir.

FileOutputStream out3 = new FileOutputStream(fileWithinMyDir3); //Use the stream as usual to write into the file.

} catch(FileNotFoundException e){

e.printStackTrace();

}

}

因此創建文件夾但在其名稱前面有“app_”開頭:app_users,app_data,app_public.有沒有辦法用我給出的名字創建文件夾?另一個問題:我想首先創建文件夾文件,而不是所有其他文件夾“數據,公共,用戶”….最后一個問題:如果我想創建一個文件,我怎么能給出正確的文件夾路徑內存中的Documents / Users / myfile.txt?

提前致謝!

總結

以上是生活随笔為你收集整理的android手机内存创建文件夹,Android在内存问题中创建文件夹的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。