Using developer.android migration guide for splash screens in android 12. My build.grade has
android {
compileSdkVersion 31
...
}
dependencies {
...
implementation 'androidx.core:core-splashscreen:1.0.0-alpha01'
}
Manifest and theme also set up. The issue I am having is with
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Handle the splash screen transition.
SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
setContentView(R.layout.main_activity);
}
}
I am getting error: cannot find symbol SplashScreen.installSplashScreen(this); with the .installSplashScreen part of code in red in Android Studio.
I have seen this stack post with some suggestions. I have tried both
import android.window.SplashScreen;
import androidx.core.splashscreen.SplashScreen;
But still getting cannot find symbol.