title: android custom button
body: <p>i would like to create a custom button like this:</p>
  
  <p><a href="http://i77.photobucket.com/albums/j74/bertyhell/button.png?t=1279626910" rel="nofollow noreferrer">http://i77.photobucket.com/albums/j74/bertyhell/button.png?t=1279626910</a></p>
  
  <p>but that doesn't work
  i need to show the text on the buttons with absolute positioning relative to the buttons origin
  all strings need to be changeable at runtime</p>
  
  <p>but the button below can be a regular button</p>
  
  <p>how can i do this?</p>
  
  <p>if i create a button by inheriting from android.widget.button i have to draw the whole button myself?</p>
  
  <p>is there an easier way?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>ok i tried the inherit from relative layout</p>
  
  <p>like this:</p>
  
  <pre><code>    package be.smarttelecom.datacheck.views;
  
      import android.content.Context;
      import android.util.Log;
      import android.widget.RelativeLayout;
      import android.widget.TextView;
  
      public class AlertButton extends RelativeLayout {
  
          private TextView roomNumber;
  
          public AlertButton(Context context, String roomNumber) {
              super(context);
              try{
              this.alertId = alertId;
              // TODO Auto-generated constructor stub
              this.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
                      LayoutParams.WRAP_CONTENT));
  
              TextView room = new TextView(context);
              room.setFocusable(false);
              room.setText(R.string.room);
              room.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
                      LayoutParams.WRAP_CONTENT));
  
              this.roomNumber = new TextView(context);
              this.roomNumber.setFocusable(false);
              this.roomNumber.setId(R.id.roomNumber);
              this.roomNumber.setTextSize(26);
              this.roomNumber.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
                      LayoutParams.WRAP_CONTENT));
              this.roomNumber.setText(roomNumber);
  
              }catch(Exception ex){
                  Log.i("test", "problem during construction of alert button: " + ex.getMessage());
              }
          }
  
          public void setRoomNumber(String number){
              roomNumber.setText(number);
          }
  
          public void setDescription(String description){
              this.description.setText(description);
          }
      }
  </code></pre>
  
  <p>when i add it like this:</p>
  
  <pre><code>        TableRow row2 = new TableRow(this);
          AlertButton alert = new AlertButton(this, "1","14","wc","krist");
          row2.addView(alert);
          container.addView(row2, 0);
  </code></pre>
  
  <p>i get an empty page and no errors at all</p>
  
  <p>any idea what i did wrong?</p>
  
  <p>how do i put the textfields on certain positions?
  put them inside an absolute layout and add x an y coordinates?
  (absolute layout is depricated, alternative?)</p>