title: Customize a xml layout in a fragment - Android
body: <p>I am new in Android programming.
  I created the main Activity of my app style google shop ussing ActionBarSherlock and a NavigationTabs, with fragments, each referencing another activity (Fragment 1 Fragment 2, etc) and each fragment inflating a layout.</p>
  
  <p>However, I'm used to create layouts in xml and then customize them in java. To put a different text depending on the time of day, or according to some data in a database, giving function to buttons, etc.. But in a Fragment Class, I can not even use setContentView to work with each text or button, and set the context for using my database is giving me problems.</p>
  
  <p>How I can customize a xml layout in a fragment?
  Or what would be the right thing to do?</p>
  
  <p>Here my Fragment:</p>
  
  <pre><code>public class Fragment1 extends SherlockFragment{
  
  
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
      return inflater.inflate(R.layout.menu, container, false);
  
  }
  </code></pre>