Merge pull request #12110 from JosJuice/android-dir-init-toast
Android: Move DirectoryInitialization toast to UI thread
This commit is contained in:
commit
fc7ef66669
|
@ -14,6 +14,7 @@ import android.widget.Toast;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.lifecycle.LiveData;
|
import androidx.lifecycle.LiveData;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
@ -73,8 +74,12 @@ public final class DirectoryInitialization
|
||||||
|
|
||||||
if (!setDolphinUserDirectory(context))
|
if (!setDolphinUserDirectory(context))
|
||||||
{
|
{
|
||||||
Toast.makeText(context, R.string.external_storage_not_mounted, Toast.LENGTH_LONG).show();
|
ContextCompat.getMainExecutor(context).execute(() ->
|
||||||
System.exit(1);
|
{
|
||||||
|
Toast.makeText(context, R.string.external_storage_not_mounted, Toast.LENGTH_LONG).show();
|
||||||
|
System.exit(1);
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
extractSysDirectory(context);
|
extractSysDirectory(context);
|
||||||
|
|
Loading…
Reference in New Issue