hi everyone :wave: I have a silly issue and I don'...
# android
a
hi everyone 👋 I have a silly issue and I don't recognize what happens, actually, this is my first time to use a library written in Java for (android+kotlin) project I use this lib https://github.com/ittianyu/BottomNavigationViewEx
Copy code
BottomNavigationViewEx (latest version) + SdkVersion 28
and I can't even declare the view to use it, I tried a few ways but always compiler error + runtime error so my question is that how I can declare this BottomNavigationViewEx View in my kotlin project
Copy code
val bottomNavigationViewEx = findViewById<BottomNavigationViewEx>(R.id.main_bottom_navigation)
java.lang.RuntimeException: Unable to start activity ComponentInfo: java.lang.ClassCastException: com.google.android.material.bottomnavigation.BottomNavigationView cannot be cast to com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
i
You have to change it on XML layout too
a
@itnoles thanks for reply, sorry change the view to what ?
i
in XML, change com.google.android.material.bottomnavigation.BottomNavigationView to com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
🙏 1
a
oooooh 😂 many thanks bro, i didn't expect this
r
I'd recommend against using that lib, it's a pretty ugly hack that uses reflection to modify the support library bottom bar control