I am trying to use VIEWSTUB inside a merge tag and its working capacity. I can catch onclicklistenr from parent button of ViewStub . But I want to access the button that is inside the viewstub.
1.Main xml:
<merge> <LinearLayout> <Button></Button> <ViewStub></ViewStub> </LinearLayout> </merge>
2.view layout layout
<Button android:id="@+id/button_cancel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minWidth="100dip" android:text="Next" /> <ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/imageView" android:background="@drawable/golden_gate" /> </LinearLayout>
I am inflating the viewing of the stub in activity ... here I want to fire the click event on the cancel button. How will this be possible
source share