title: android: put window custom titlebar controls in a seperate class
body: <p>I followed an online tutorial teaching how to build a custom title bar in android.
  After you build the layout, here is how to add it onto an activity:</p>
  
  <pre><code>requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
  ... 
  getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title);
  </code></pre>
  
  <p>And if you add onClickListeners on the buttons which are part of the titlebar, you do this:</p>
  
  <pre><code>Button b1 = (Button) findViewById(R.id.b1);
          b1.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent();
                  intent.setClass(MyApp.this, News.class);
  
                  startActivity(intent);
              }
          });
  </code></pre>
  
  <p>This has to be done everytime you want to add a titlebar to an activity.</p>
  
  <p>Is there a way to create a class for the titlebar and throw all in there so I dont have to repeat myself on each activity?</p>