Use Android 12 splash screen

This commit is contained in:
M66B
2021-08-26 08:40:33 +02:00
parent f173bd9e4b
commit 9090681303
2 changed files with 19 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import androidx.fragment.app.FragmentManager;
@@ -135,12 +136,14 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
final SimpleTask<Boolean> boot = new SimpleTask<Boolean>() {
@Override
protected void onPreExecute(Bundle args) {
getMainHandler().postDelayed(splash, SPLASH_DELAY);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S)
getMainHandler().postDelayed(splash, SPLASH_DELAY);
}
@Override
protected void onPostExecute(Bundle args) {
getMainHandler().removeCallbacks(splash);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S)
getMainHandler().removeCallbacks(splash);
getWindow().setBackgroundDrawable(null);
}