在问题Take screensot and save android中有人告知如何将我的应用程序中创建的图像保存到 SD 卡。现在我正在尝试上传图片,但首先我需要找到如何获取路径。我使用的整个代码在最后一个问题中,我需要知道如何获取我保存的图像的路径。有什么建议吗?
最佳答案
检查这些行:
String root = Environment.getExternalStorageDirectory().toString();
File myDir = new File(root + "/MyDraw");
myDir.mkdirs();
file = new File (myDir, name+".png");
file
是指向 Bitmap 保存位置的 File 对象。
关于java - 获取保存到android SD卡的文件的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16697230/