File tree 1 file changed +5
-2
lines changed
app/src/main/java/com/nutomic/syncthingandroid/activities
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -398,15 +398,18 @@ public void onClick(View v) {
398
398
// Get app specific /Android/media directory.
399
399
ArrayList <File > externalFilesDir = new ArrayList <>();
400
400
externalFilesDir .addAll (Arrays .asList (getExternalMediaDirs ()));
401
+ if (externalFilesDir .size () > 0 ) {
402
+ externalFilesDir .remove (externalFilesDir .get (0 ));
403
+ }
401
404
externalFilesDir .remove (null ); // getExternalFilesDirs may return null for an ejected SDcard.
402
- if (externalFilesDir .isEmpty () ) {
405
+ if (externalFilesDir .size () == 0 ) {
403
406
Log .w (TAG , "Failed to export config. Could not determine app's private files directory on external storage." );
404
407
Toast .makeText (FirstStartActivity .this ,
405
408
getString (R .string .config_export_failed ),
406
409
Toast .LENGTH_LONG ).show ();
407
410
return ;
408
411
}
409
- final String exportToMediaPath = externalFilesDir .get (externalFilesDir . size () > 1 ? 1 : 0 ).getAbsolutePath ();
412
+ final String exportToMediaPath = externalFilesDir .get (0 ).getAbsolutePath ();
410
413
if (!exportConfig (exportToMediaPath )) {
411
414
Toast .makeText (FirstStartActivity .this ,
412
415
getString (R .string .config_export_failed ),
You can’t perform that action at this time.
0 commit comments