I am trying to create a directory on my Android emulator, but I can’t do it, I already have permission to write_storage manifest and I don’t get any erros, but mkdir () returns false, I check if the external storage is the same, too, it works on physical devices of my code:
/// Cria uma nova pasta para colocar o backup File direct = new File(Environment.getExternalStorageDirectory(), "/Financas RW Backup"); try { if (!direct.exists()) { if(isExternalStorageWritable()&&isExternalStorageReadable()) { if( direct.mkdir()) { fachada.showMessage(ExportImportDB.this," Criado"); }else{ fachada.showMessage(ExportImportDB.this," Não Criado"); } } } } catch (Exception e) { fachada.showMessage(this, e.toString()); }
source share