title: How do i align a view in RelativeLayout to top-right corner
body: <p>Im trying to figure out how to align a view in relative layout to its top right corner.
  Currently it is aligned in top left corner.</p>
  
  <p>A simple problem, yet I dont know how to do it.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>        RelativeLayout.LayoutParams gpsViewLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT );
      gpsViewLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
      gpsViewLayoutParams.addRule(RelativeLayout.ALIGN_RIGHT);
      this.relativeLayout.addView(gpsView,gpsViewLayoutParams); 
  </code></pre>