title: How to find out latitude and longitude from address which get from spinner in android
body: <p>How to find out latitude and longitude from the address...</p>
  
  <p>Here's the code for the 
  spinner where we get the value of address </p>
  
  <pre><code>       landmark_addprod.setOnItemSelectedListener(new OnItemSelectedListener(){
          public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos,long id)
          {
              // ListView Clicked item value
              itemValue_landmark = (String) landmark_addprod.getItemAtPosition(pos);
          }
  </code></pre>
  
  <p>and here get the value of city</p>
  
  <pre><code>            public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos,long id)
              {
                  itemPosition_city = pos;
  
                    // ListView Clicked item value
                     itemValue_city = (String) city_addprod.getItemAtPosition(pos);
              }
  </code></pre>
  
  <p>So how to concatenate the address and city values and how to find out lat longitude from that???</p>
  
  <p>also used--</p>
  
  <pre><code>                Geocoder coder = new Geocoder(addproducts.this);
               try 
                  {
              ArrayList&lt;Address&gt; adresses = (ArrayList&lt;Address&gt;) coder.getFromLocationName(itemValue_landmark + itemValue_city, 1);
              for(Address add : adresses){
                      longitude = add.getLongitude();
                      latitude = add.getLatitude();
                  } 
              }
          catch (IOException e) {
                  e.printStackTrace();
              }
  </code></pre>
  
  <p>but get the latitude and longitude 0.0</p>