title: How to Handle onClick in Fragments
body: <p>This is my first try on Fragments and I'm not able to handle android:onClick</p>
  
  <p>I have a button inside my fragment XML like this</p>
  
  <pre><code>    &lt;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" /&gt;
  </code></pre>
  
  <p>I searched many results and can't get the exact solution to handle the onClick event.</p>
  
  <p>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? </p>