这是Android系统的一种隐藏文件的方式,这些文件以点开头命名是为了使它们在文件夹中排在前面。为了显示这些文件,需要在计算机中打开文件管理器,显示隐藏文件选项,并在文件名前面加上一个点符号来显示这些文件。
示例代码如下:
//打开文件管理器,显示隐藏文件 Intent intent = new Intent(Intent.ACTION_GET_CONTENT); Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath()); intent.setDataAndType(uri, "/"); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); intent.putExtra("android.provider.extra.SHOW_ADVANCED", true); startActivityForResult(Intent.createChooser(intent, "Open folder"), 0);
//显示以点开头命名的文件 File folder = new File(Environment.getExternalStorageDirectory().getPath()); File[] files = folder.listFiles(new FilenameFilter() { public boolean accept(File dir, String filename) { return filename.startsWith("."); } });