title: Implementing buttons inside fragments - how to create the interface to communicate the fragments with activity
body: <p>I find a nice layout with fragments <a href="http://thepseudocoder.wordpress.com/2011/10/13/android-tabs-viewpager-swipe-able-tabs-ftw/" rel="nofollow">here</a></p>
  
  <p>I add buttons to the xml fragments but I do not know how to implement the buttons, I mean, I do not know how to do for the buttons work.</p>
  
  <p>The problem is that I need to create a callback interface inside the fragment and require that the host activity implement it and than the activity receives a callback through the interface:</p>
  
  <p><a href="http://developer.android.com/guide/components/fragments.html" rel="nofollow">Fragments in Android</a></p>
  
  <p>Unfortunately, it is not clear how to do it with buttons.</p>
  
  <p>In short, I have my buttons and I do not know how to make it work.</p>