mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Android: Move DirectoryInitialization toast to UI thread
You're not allowed to just show toasts on any thread you want.
This commit is contained in:
parent
54d3a226f3
commit
4b1b5881b0
@ -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;
|
||||||
@ -72,9 +73,13 @@ public final class DirectoryInitialization
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!setDolphinUserDirectory(context))
|
if (!setDolphinUserDirectory(context))
|
||||||
|
{
|
||||||
|
ContextCompat.getMainExecutor(context).execute(() ->
|
||||||
{
|
{
|
||||||
Toast.makeText(context, R.string.external_storage_not_mounted, Toast.LENGTH_LONG).show();
|
Toast.makeText(context, R.string.external_storage_not_mounted, Toast.LENGTH_LONG).show();
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
extractSysDirectory(context);
|
extractSysDirectory(context);
|
||||||
|
Loading…
Reference in New Issue
Block a user