Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #12110 from JosJuice/android-dir-init-toast
Android: Move DirectoryInitialization toast to UI thread
  • Loading branch information
AdmiralCurtiss committed Aug 17, 2023
2 parents a087920 + 4b1b588 commit fc7ef66
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -14,6 +14,7 @@
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;
Expand Down Expand Up @@ -73,8 +74,12 @@ private static void init(Context context)

if (!setDolphinUserDirectory(context))
{
Toast.makeText(context, R.string.external_storage_not_mounted, Toast.LENGTH_LONG).show();
System.exit(1);
ContextCompat.getMainExecutor(context).execute(() ->
{
Toast.makeText(context, R.string.external_storage_not_mounted, Toast.LENGTH_LONG).show();
System.exit(1);
});
return;
}

extractSysDirectory(context);
Expand Down

0 comments on commit fc7ef66

Please sign in to comment.