Невозможно найти символ SplashScreen.installSplashScreen(this);JAVA

Программисты JAVA общаются здесь
Гость
Невозможно найти символ SplashScreen.installSplashScreen(this);

Сообщение Гость »

Использование руководства по миграции Developer.android для заставок в Android 12. В моем build.grade

Код: Выделить всё

android {
compileSdkVersion 31
...
}
dependencies {
...
implementation 'androidx.core:core-splashscreen:1.0.0-alpha01'
}
Манифест и тема также настроены. У меня проблема с

Код: Выделить всё

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Handle the splash screen transition.
SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
setContentView(R.layout.main_activity);
}
}
Я получаю сообщение об ошибке: не могу найти символ SplashScreen.installSplashScreen(this); с частью кода .installSplashScreen, выделенной красным в Android Studio.
Я видел этот пост с некоторыми предложениями. Я пробовал оба

Код: Выделить всё

import android.window.SplashScreen;
import androidx.core.splashscreen.SplashScreen;
Но по-прежнему не удается найти символ.

Подробнее здесь: https://stackoverflow.com/questions/706 ... screenthis

Вернуться в «JAVA»