title: Android Studio button positioning
body: <p>I'm trying to set button position to the bottom right corner of the screen. I've tried with this:</p>
  
  <pre><code>button.setX(maxX);
  button.setY(maxY);
  </code></pre>
  
  <p>but the button is invisible because it's off the screen.</p>
  
  <p>EDIT: To clarify. I need to find a way to keep my button WITHIN layout when I set its position to <code>maxX</code> and <code>maxY</code>. To prevent it from going out of bounds. So even if I set its position to something like: </p>
  
  <pre><code>button.setX(maxX - 10);
  button.setY(maxY - 10);
  </code></pre>
  
  <p>it wouldn't stick half out of the screen.</p>