Javadoc for Environment.getExternalStoragePublicDirectory()中的示例提到Context.getExternalMediaDir()
但此方法在我的 Android API 版本中不可用,我无法在任何版本的任何地方找到它的文档。这是一个错字还是从未发布的东西?
void createExternalStoragePublicPicture() {
// Create a path where we will place our picture in the user's
// public pictures directory. Note that you should be careful about
// what you place here, since the user often manages these files. For
// pictures and other media owned by the application, consider
// Context.getExternalMediaDir().
File path = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES);