How can I extend ImageView, so that I can use in my code findViewById?
I just got 25 ImageViewand I need after click on one to get some value.
I know that I have to create new class, extends ImageView and add constructors, but when I try to implement as findViewById, I got error:
FATAL EXCEPTION: main
java.lang.ClassCastException: android.widget.ImageView
at com.emirates.worldstreets.explore.FashionTab.setUpStars(FashionTab.java:457)
at com.emirates.worldstreets.explore.FashionTab.fillUpDetails(FashionTab.java:376)
at com.emirates.worldstreets.explore.FashionTab.access$8(FashionTab.java:326)
at com.emirates.worldstreets.explore.FashionTab$4.onItemClick(FashionTab.java:317)
at android.widget.AdapterView.performItemClick(AdapterView.java:284)
at android.widget.ListView.performItemClick(ListView.java:3382)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
in code you use findViewById the same way you would with a normal ImageView but with a cast to your custom view
in xml you need to specify the full path of the class