Lompat ke konten Lompat ke sidebar Lompat ke footer

Fungsi Delete Files & Reaload Activity Android Studio

 

Delete File Function

//folder
String arah = Environment.getExternalStorageDirectory().getAbsolutePath() + "/RanairuCreation/Favorite/"+name;

//fungsi hapus
File file = new File(arah);
file.delete();
if(file.exists()){
try {
file.getCanonicalFile().delete();
} catch (IOException e) {
e.printStackTrace();
}
if(file.exists()){
getApplicationContext().deleteFile(file.getName());
}
}

 Fungsi Reaload Activity

//Reload Activity
finish();
startActivity(getIntent());

 

 

close