title: Display alert dialog box based on Maps place Click?
body: <p>I am practicing the Android maps now i am getting the maps successfully in my emulator when i search in the Google market i found one  Interesting App i am try for to develop the example app is </p>
  
  <p><a href="https://play.google.com/store/apps/details?id=streetdirectory.mobile&amp;feature=search_result#?t=W251bGwsMSwxLDEsInN0cmVldGRpcmVjdG9yeS5tb2JpbGUiXQ" rel="nofollow">https://play.google.com/store/apps/details?id=streetdirectory.mobile&amp;feature=search_result#?t=W251bGwsMSwxLDEsInN0cmVldGRpcmVjdG9yeS5tb2JpbGUiXQ</a>..</p>
  
  <pre><code>package com.example.tutorials;
  
  import java.io.IOException;
  import java.util.Locale;
  
  import android.app.Activity;
  import android.content.Context;
  import android.graphics.drawable.Drawable;
  import android.location.Geocoder;
  import android.location.LocationManager;
  import android.os.Bundle;
  
  import com.google.android.maps.GeoPoint;
  import com.google.android.maps.MapActivity;
  import com.google.android.maps.MapController;
  import com.google.android.maps.MapView;
  
  import com.google.android.maps.MapView.LayoutParams;  
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.LinearLayout;
  import android.widget.Toast;
  
  
  public class GoogleMap extends MapActivity  
  {
  
       MapView mapView; 
  
      /** Called when the activity is first created. */
      @Override
      protected boolean isRouteDisplayed() 
      {
      return false;
      }
  
      public void changeMap(String area)
      {
  
      mapView = (MapView) findViewById(R.id.mapview);
      MapController mc=mapView.getController();
  
  
      GeoPoint myLocation=null;
  
      double lat = 0;
      double lng = 0;
      try
      {
  
      Geocoder g = new Geocoder(this, Locale.getDefault());
  
      java.util.List&lt;android.location.Address&gt; result=g.getFromLocationName(area, 1);
      if(result.size()&gt;0){
  
      Toast.makeText(GoogleMap.this, "country: " + String.valueOf(result.get(0).getCountryName()), Toast.LENGTH_SHORT).show();
      lat = result.get(0).getLatitude();
      lng = result.get(0).getLongitude();
  
      }            
      else{
      Toast.makeText(GoogleMap.this, "record not found", Toast.LENGTH_SHORT).show();
      return;
      }
      }
      catch(IOException io)
      {
      Toast.makeText(GoogleMap.this, "Connection Error", Toast.LENGTH_SHORT).show();
      }
      myLocation = new GeoPoint(
      (int) (lat * 1E6),
      (int) (lng * 1E6));
      Drawable drawable = this.getResources().getDrawable(R.drawable.icon);
      mc.animateTo(myLocation);
      mc.setZoom(10);
      mapView.invalidate();
      }
          @Override
          public void onCreate(Bundle savedInstanceState)
          {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          Button btnSearch=(Button) findViewById(R.id.btnSearch);
          btnSearch.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
  
          EditText txtSearch=(EditText)findViewById(R.id.txtMapSearch);
          String area=txtSearch.getText().toString();
          Toast.makeText(GoogleMap.this, "Click-" + String.valueOf(area), Toast.LENGTH_SHORT).show();
          GoogleMap.this.changeMap(area);
  
  
                      }
          });
  
          mapView = (MapView) findViewById(R.id.mapview);
          MapController mapController = mapView.getController();
          mapController.setZoom(14);
  
          LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom); 
  
          }
  
      }
  </code></pre>
  
  <p>by this code i am getting search place in Android maps.how can i provide dialog box .when we click on the maps place?</p>
  
  <p>Thanks in Advance...... </p>