This is my first try on Fragments and I'm not able to handle android:onClick
I have a button inside my fragment XML like this
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/save_keywords_button"
android:id="@+id/save_keywords"
android:layout_marginTop="340dp"
android:background="#FF2E7D32"
android:textColor="#FFFFFF"
android:typeface="normal"
android:onClick="myLogic" />
I searched many results and can't get the exact solution to handle the onClick event.
My question is, How can I get the ID of my button and write the myLogic method. FindViewById() is not working in fragments and where should I write the method? in fragment or in my activity?