'Biometric authentication crashes in API Level Below 28. I am very new to android I am very confuse writing the else part

I want to continue with the main activity without promoting the figure print for API levels below 28

get() =
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
        object : BiometricPrompt.AuthenticationCallback() {
            override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) {
                super.onAuthenticationError(errorCode, errString)
                notifyUser("Authentication Error: $errString")
            }

            override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult?) {
                super.onAuthenticationSucceeded(result)
                notifyUser("Authentication Successful!")
    //            startActivity(Intent(this@MainActivity,MainActivity::class.java))
    //            finish()
            }
        }
    } else {
        startActivity(this)

    }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source