title: How to get left and top of image view in frame layout for android?
body: <p>I need to get left an top of an image view which is in frame layout while selecting the spinner. This is my code. </p>
  
  <pre><code>      location_spinner.setOnItemSelectedListener(new OnItemSelectedListener() 
      {
   String scr;
  
    @Override
    public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position1, long id) 
    {
  
  
       selscr = location_spinner.getSelectedItem().toString();
       src_position = position1;
       System.out.println("selscr---&gt;"+selscr);
      System.out.println("src_position---&gt;"+src_position);
  
  
      floor_code=selscr.substring(selscr.length() - 1);
      System.out.println("The selscr"+floor_code);
  
  
    }
  
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; arg0)
      {
          // TODO Auto-generated method stub
  
      }  
     });
  
  
  
     get_location_bt.setOnClickListener(new View.OnClickListener() 
    {
  
      @Override
      public void onClick(View arg0) 
      {
      if(src_position==0)//selscr.equalsIgnoreCase("-Select-") &amp;&amp; seldes.equalsIgnoreCase("-Select-"))
      {
          ground_image.setBackgroundResource(R.drawable.gray);
      }
  
      else if(floor_code.equalsIgnoreCase("G"))
      {
  
  
          ground_frame2.setVisibility(View.INVISIBLE);
  
  
          new_rad.setVisibility(View.INVISIBLE);
           System.out.println("new_rad before id"+new_rad.getId());
           new_rad = ver.get(src_position-1);
         //new_rad.setBackgroundResource(R.drawable.location_icon);
           new_rad.setVisibility(View.VISIBLE); 
           System.out.println("new_rad after id"+new_rad.getId());
           int x_value = new_rad.getLeft();
           int y_value = new_rad.getTop();
           System.out.println("x_value + y_value----&gt;"+x_value+y_value);
           ground_frame2.setLeft((int) (1500/3.0-x_value));
           ground_frame2.setTop((int)(1119/3.0-y_value));             
           ground_frame2.setVisibility(View.VISIBLE); 
  
      }
   }
      }); 
  </code></pre>
  
  <p>When i use like this its works finely. </p>
  
  <pre><code>  Intent gound_fr = new Intent(LocateStore.this,GroundLoc.class);
    gound_fr.putExtra("src",src_position);
  </code></pre>
  
  <p>But when i use intent in else if part it doesn't get X and Y values. The methods return as zero. How can i resolve this? Can anybody tell me? Thanks in advance.</p>