title: getX() not working for button?
body: <p>I used the following method for getting x and y values of my button.It returns 0 always.What might be the problem ?</p>
  
  <pre><code>btn_show.setOnClickListener(new OnClickListener()
               {
                    @Override
                   public void onClick(View arg0) 
                   {
                         int x = (int)btn_show.getX();
                         int y=  (int)btn_show.getY();
  
                      Toast.makeText(getApplicationContext(), "button x is......"+x,Toast.LENGTH_SHORT ).show();
                      Toast.makeText(getApplicationContext(), "button y is......"+y,Toast.LENGTH_SHORT ).show();
       }
                 });
  </code></pre>
  
  <p>I used this method to pass the value to another activity</p>
  
  <pre><code>Intent i = new Intent(getApplicationContext(), CustomDialogExample.class);
                      i.putExtra("value",popup_height);
                      startActivity(i);
  </code></pre>
  
  <p>And this method to retrieve the value</p>
  
  <pre><code>Intent i = getIntent();
           int intValue = i.getIntExtra("value", 0);
  </code></pre>
  
  <p>Finally this to set my popup position</p>
  
  <pre><code>Window window = customizeDialog.getWindow();
              WindowManager.LayoutParams wlp = window.getAttributes();
              wlp.y =intValue;
              window.setAttributes(wlp);
  </code></pre>
  
  <p>The variable intValue returns 0 always</p>