Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First thing you need to do is the class of OnClickListener should be as following:- </p> <pre><code> public void onCreate(Bundle savedInstanceState){ Button btn_find = (Button) findViewById(R.id.btn_find); btn_find.setOnClickListener(findClickListener); } OnClickListener findClickListener = new OnClickListener() { @Override public void onClick(View v) { // Getting reference to EditText to get the user input location EditText etLocation = (EditText) findViewById(R.id.et_location); // Getting user input location String location = etLocation.getText().toString(); if(location!=null &amp;&amp; !location.equals("")){ new GeocoderTask().execute(location); } } }; </code></pre> <p>check this out and try to clean your projects ...!!!!</p> <p>use your layout as following:-</p> <pre><code>&lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" &gt; &lt;Button android:id="@+id/btn_find" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/str_btn_find" android:layout_alignParentRight="true" /&gt; &lt;EditText android:id="@+id/et_location" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="text" android:hint="@string/hnt_et_location" android:layout_toLeftOf="@id/btn_find" /&gt; &lt;com.google.android.maps.MapView android:id="@+id/map_view" android:layout_width="fill_parent" android:layout_height="wrap_content" android:apiKey="02XkocQETlvu36mzmDnwYr-A4GTX5mENmESOG8A" android:clickable="true" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>and check it out...!!!!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload