title: set position of relativelayout
body: <p>For some reason the position ( margin ) of the layout i have created is not set. the layout shows up at x=0 and y=0. What am I doing wrong? </p>
  
  <pre><code>smallPopup = new LinearLayout(this);
  
  LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
  p.setMargins(100, 100, 10, 10);
  
  smallPopup.setLayoutParams(p);
  smallPopup.setGravity(Gravity.CENTER_VERTICAL);
  smallPopup.setHorizontalGravity(Gravity.CENTER_HORIZONTAL);
  smallPopup.setBackgroundResource(R.drawable.map_small_popup_overlay);
  smallPopup.setPadding(20, 10, 20, 10);
  
  map.addView(smallPopup, p);
  </code></pre>