I am new to Kotlin. I have an android project which I opted to convert to kotlin. This is my piece of code.
import com.beardedhen.androidbootstrap.BootstrapButton
class EndTrip : AppCompatActivity(){
internal var endtrip: BootstrapButton ?= null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_end_trip)
endtrip.setOnClickListener(View.OnClickListener {
//Some code here
}
}
}
But I get this error on the endtrip
Smart cast to BootsrapButton is impossible because endtrip is mutable property that have changed by this time
A similar question has been answered here but i cant figure out the solution. I am using beardedhen Android Bootstrap Library. Thank you.