Merge pull request #12110 from JosJuice/android-dir-init-toast

Android: Move DirectoryInitialization toast to UI thread
This commit is contained in:
Admiral H. Curtiss 2023-08-18 00:15:15 +02:00 committed by GitHub
commit fc7ef66669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.preference.PreferenceManager;
@ -72,9 +73,13 @@ public final class DirectoryInitialization
return;
if (!setDolphinUserDirectory(context))
{
ContextCompat.getMainExecutor(context).execute(() ->
{
Toast.makeText(context, R.string.external_storage_not_mounted, Toast.LENGTH_LONG).show();
System.exit(1);
});
return;
}
extractSysDirectory(context);