Commit c7d4b10e authored by 9731301's avatar 9731301

debug delete voices

parent 618fc2ca
......@@ -43,6 +43,7 @@ public class AudioListFragment extends Fragment {
private ImageButton playerPlayBtn;
private TextView fileNameTv , headerTitleTv;
private SeekBar seekBar;
private File[] files;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
......@@ -81,7 +82,7 @@ public class AudioListFragment extends Fragment {
String path = root.getAbsolutePath() + "/NotepadVoiceRecorder/Audios";
Log.d("Files", "Path: " + path);
File directory = new File(path);
File[] files = directory.listFiles();
files = directory.listFiles();
if (files != null) {
for (int i = 0; i < files.length; i++) {
String fileName = files[i].getName();
......@@ -146,9 +147,15 @@ public class AudioListFragment extends Fragment {
alert.setPositiveButton("yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (files!= null){
for (int j = 0 ; j < files.length ; j++){
if (files[j].getAbsolutePath().equals(myChosenVoice.getUri())){
files[j].delete();
myVoiceArrayList.remove(myChosenVoice);
System.out.println(myChosenVoice.getFileName() + " " + myChosenVoice.getUri());
new File(myChosenVoice.getFileName()).delete();
}
}
}
customToolbarOption.setVisibility(View.GONE);
recyclerViewRecordings.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
recyclerViewRecordings.setHasFixedSize(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment