Advertisement
Sketchware

Verifica se existe pasta dentro da pasta c do celular

Jan 20th, 2023
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. File dir = new File(Environment.getExternalStorageDirectory() + "/myDirectory");
  2. if(dir.exists() && dir.isDirectory()) {
  3.     Toast.makeText(getApplicationContext(), "Directory Found", Toast.LENGTH_SHORT).show();
  4. } else {
  5.     Toast.makeText(getApplicationContext(), "Directory Not Found", Toast.LENGTH_SHORT).show();
  6. }
  7.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement