title: android button in class
body: <p>All i want to do is to have a class that creates dynamically a button and fills it with the text 'tarr' automatically. So i generated a new class and wrote the following in it:</p>
  
  <pre><code>import android.widget.Button;
  
  public class FloatButton {
      Button button = new Button(this);
  
      button.setText("tarr");
  }
  </code></pre>
  
  <p>in my main activity it should make an object of this class. So i wrote this in the activity (snippet):</p>
  
  <pre><code>...
  
  public void onCreate() {
      super.onCreate();
  
      FloatButton myButton = new FloatButton();
  }
  </code></pre>
  
  <p>Sadly this gives me some mistakes marked. The mistake i don't realy understand is why the 'this' is marked. Can you tell me the problem?</p>