@@ -78,6 +78,7 @@ public class FileActivity extends AppCompatActivity implements FileRecyclerAdapt
78
78
*/
79
79
public static final String PARAM_DEFAULT_FILENAME = "default_filename" ;
80
80
private static final String P_KEY_FA_LAST_DIR = "last_directory" ;
81
+ private static final String P_KEY_FA_LAST_DIR_MEDIA = "last_dir_media" ;
81
82
private static final String P_KEY_FA_LAST_FILENAME = "last_filename" ;
82
83
private static final String P_KEY_FA_SORT = "FA_sorting_name" ;
83
84
private static final String TAG = "FileActivity" ;
@@ -344,7 +345,11 @@ private void loadStartDirectory(SharedPreferences settings){
344
345
if (settings .contains (P_KEY_FA_LAST_FILENAME )){
345
346
tFileName .setText (settings .getString (P_KEY_FA_LAST_FILENAME ,"" ));
346
347
}
347
- filePickerViewModel .goToFile (folder , null , this ,true );
348
+ if (settings .getBoolean (P_KEY_FA_LAST_DIR_MEDIA , false )){
349
+ filePickerViewModel .goToMediaSelection (this );
350
+ } else {
351
+ filePickerViewModel .goToFile (folder , null , this , true );
352
+ }
348
353
}
349
354
350
355
@ Override
@@ -364,6 +369,7 @@ protected void onStop() {
364
369
String folderPath = null ;
365
370
if (filePickerViewModel .getCurrentFolder () != null )
366
371
folderPath = filePickerViewModel .getCurrentFolder ().getAbsolutePath ();
372
+ editor .putBoolean (P_KEY_FA_LAST_DIR_MEDIA ,filePickerViewModel .getCurrentFolder () == null );
367
373
editor .putString (P_KEY_FA_LAST_DIR , folderPath );
368
374
editor .putBoolean (P_KEY_FA_SORT , sorting_name );
369
375
editor .apply ();
@@ -413,6 +419,7 @@ private void displayLoadingToast() {
413
419
* Display indeterminate progress dialog
414
420
*/
415
421
private void showProgressDialog (){
422
+ recyclerView .stopScroll (); // prevent crash through update while scrolling
416
423
progressDialog = ProgressDialog .newInstance ();
417
424
progressDialog .setDisplayMode (true ,0 , R .string .File_Loading ,null );
418
425
if (!progressDialog .isAdded ())
0 commit comments