Skip to content
Advertisement

convert java class to kotlin inherited from FragmentStatePageAdapter

I am doing a project and the only help I have are in java, and it is making it very difficult for me to have to convert it or pass it to kotlin this is the code I have to pass to kotlin:

JavaScript

and when trying to convert it, it was more or less like this:

JavaScript

According to how little I know, Kotlin is looking very bad as seen in the following screenshot:

enter image description here

In case you’re wondering I’m trying to fragment an actity

Advertisement

Answer

You got that error because the Kotlin code has some syntax errors. Here is the right one.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement