Version 10 - Fixed Download

This commit is contained in:
Caesar2011
2018-11-08 21:59:23 +01:00
parent a1ce5c644a
commit 17c093c040
3 changed files with 5 additions and 5 deletions

View File

@@ -117,7 +117,7 @@ public class ModDetailAnnounceFragment extends Fragment implements Download.OnDo
super.onAttach(context); super.onAttach(context);
if (context instanceof MainActivityListener) { if (context instanceof MainActivityListener) {
this.context = ((MainActivityListener) context); this.context = ((MainActivityListener) context);
this.context.addRequestPermissionsResultListener(getDownload().getRequestPermissionsResultListener(), "ModDetailResourceFragment"); this.context.addRequestPermissionsResultListener(getDownload().getRequestPermissionsResultListener(), "ModDetailAnnounceFragment");
} else } else
throw new RuntimeException(context.toString() + " must implement MainActivityListener"); throw new RuntimeException(context.toString() + " must implement MainActivityListener");
} }
@@ -125,7 +125,7 @@ public class ModDetailAnnounceFragment extends Fragment implements Download.OnDo
@Override @Override
public void onDetach() { public void onDetach() {
super.onDetach(); super.onDetach();
this.context.removeRequestPermissionsResultListener("ModDetailResourceFragment"); this.context.removeRequestPermissionsResultListener("ModDetailAnnounceFragment");
} }
Download getDownload() { Download getDownload() {

View File

@@ -117,7 +117,7 @@ public class ModDetailAssignmentFragment extends Fragment implements Download.On
super.onAttach(context); super.onAttach(context);
if (context instanceof MainActivityListener) { if (context instanceof MainActivityListener) {
this.context = ((MainActivityListener) context); this.context = ((MainActivityListener) context);
this.context.addRequestPermissionsResultListener(getDownload().getRequestPermissionsResultListener(), "ModDetailResourceFragment"); this.context.addRequestPermissionsResultListener(getDownload().getRequestPermissionsResultListener(), "ModDetailAssignmentFragment");
} else } else
throw new RuntimeException(context.toString() + " must implement MainActivityListener"); throw new RuntimeException(context.toString() + " must implement MainActivityListener");
} }
@@ -125,7 +125,7 @@ public class ModDetailAssignmentFragment extends Fragment implements Download.On
@Override @Override
public void onDetach() { public void onDetach() {
super.onDetach(); super.onDetach();
this.context.removeRequestPermissionsResultListener("ModDetailResourceFragment"); this.context.removeRequestPermissionsResultListener("ModDetailAssignmentFragment");
} }
Download getDownload() { Download getDownload() {

View File

@@ -613,7 +613,7 @@ class KVVModuleList extends HTTPService {
// Saves file in folder: DOWNLOADS/moduleName // Saves file in folder: DOWNLOADS/moduleName
File folder = new File(Environment.getExternalStoragePublicDirectory( File folder = new File(Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_DOWNLOADS), moduleName); Environment.DIRECTORY_DOWNLOADS), moduleName);
if (!folder.mkdir()) { if (!folder.mkdirs()) {
log.w( "Directory not created", folder.toString()); log.w( "Directory not created", folder.toString());
} }
String path = ""; String path = "";