title: in android i'm getting IOException in Geocoder
body: <p>it throw IOException if the network is unavailable or any other I/O problem occurs. It need internet connection to use Geocoder.</p>
  
  <pre><code>   public class MainActivity extends Activity {
  
     double LATITUDE = 37.42233;
     double LONGITUDE = -122.083;
  
     /** Called when the activity is first created. */
     @Override
      public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);
     TextView myLatitude = (TextView)findViewById(R.id.mylatitude);
     TextView myLongitude = (TextView)findViewById(R.id.mylongitude);
     TextView myAddress = (TextView)findViewById(R.id.myaddress);
  
     myLatitude.setText("Latitude: " + String.valueOf(LATITUDE));
     myLongitude.setText("Longitude: " + String.valueOf(LONGITUDE));
  
     Geocoder geocoder = new Geocoder(this, Locale.ENGLISH);
  
     try {
     List&lt;Address&gt; addresses = geocoder.getFromLocation(LATITUDE, LONGITUDE, 1);
  
     if(addresses != null) {
     Address returnedAddress = addresses.get(0);
     StringBuilder strReturnedAddress = new StringBuilder("Address:\n");
     for(int i=0; i&lt;returnedAddress.getMaxAddressLineIndex(); i++) {
     strReturnedAddress.append(returnedAddress.getAddressLine(i)).append("\n");
     }
    myAddress.setText(strReturnedAddress.toString());
    }
   else{
   myAddress.setText("No Address returned!");
   }
   } catch (IOException e) {
   e.printStackTrace();
  myAddress.setText("Cannot get Address!");//and tell me what is 
  }
  
   }
  }
  </code></pre>
  
  <p>anyone has any idea?</p>
  
  <p>I have managed to do it with Emulator 2.1 api 8, but then the reverse geocoding always give an empty result. anyone could confirm my code?</p>
  
  <p><strong>log cat</strong> </p>
  
  <pre><code>      06-03 10:59:24.689: W/System.err(4129):java.io.IOException: Service not Available
                         :at android.location.Geocoder.getFromLocation(Geocoder.java:136)
  
                     :at com.example.gprsonandoff.MainActivity.city(MainActivity.java:74)
  
                  :at com.example.gprsonandoff.MainActivity.onCreate(MainActivity.java:44)
             :android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  
           :at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
  </code></pre>