0

I am very very new to Android Studio. I am trying to remake my game from Godot in Android Studio.

I am getting this error in the fullscreenActivity.kt: Type Mismatch Required: WindowInsetsController? Found: Int. I'm not really sure whats going on. Below is the code it is refering too. Any help would be greatly appreciated.

`class FullscreenActivity : AppCompatActivity() {

private lateinit var binding: ActivityFullscreenBinding
private lateinit var fullscreenContent: TextView
private lateinit var fullscreenContentControls: LinearLayout
private val hideHandler = Handler(Looper.myLooper()!!)

@SuppressLint("InlinedApi")
private val hidePart2Runnable = Runnable {
    // Delayed removal of status and navigation bar
    if (Build.VERSION.SDK_INT >= 30) {
        fullscreenContent.windowInsetsController?.hide(WindowInsets.Type.statusBars() or WindowInsets.Type.navigationBars())
    } else {
        // Note that some of these constants are new as of API 16 (Jelly Bean)
        // and API 19 (KitKat). It is safe to use them, as they are inlined
        // at compile-time and do nothing on earlier devices.
        fullscreenContent.windowInsetsController =
            View.SYSTEM_UI_FLAG_LOW_PROFILE or
                    View.SYSTEM_UI_FLAG_FULLSCREEN or
                    View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
                    View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY or
                    View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
                    View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
    }
}`

I have not tried anything as i'm still learning Kotlin.

0 Answers0