Skip to content
Advertisement

FIXED What is wrong with my return in onCreateView

I have a problem with my Kotlin Android App. So far I haven’t written such a large project in Kotlin, so I totally don’t know what’s wrong.

When I try to start my application, I recive a wall of red lines. I found some solutions (for Java) and tried to implement them to my code, but it didn’t work.

JavaScript

and I think that the problem is in HomeFragment.kt:33 (in a fun onCreateView, exactly in return)

JavaScript

Can somebody tell me where is a problem and how can I fix it? (below a fragment_home.xml)

JavaScript

[FIXED] I fix my mistake (pointed in first comment) and delete tools:context=”.MainActivity” from fragment xml

Advertisement

Answer

JavaScript

This line is wrong. searchHintIcon is a drawable, not string. You can put something like

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