EditText problem
<p>I want to get a character of a string from a EditText and at the same time want to show the current location's latitude and longitude.</p>

<p>here shown a part of the code</p>

<pre><code>Button btn=(Button)findViewById(R.id.format);


 btn.setOnClickListener(new Button.OnClickListener() {

    public void onClick(View v) {

                showCurrentLocation();
        }
        });

protected void showCurrentLocation() {

         text=name.getText().toString();

         String finalText = "";
         finalText = Character.toString(text.charAt(3));

        Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

        if (location != null) {
                String message = String.format(
                                "Current Location \n Longitude: %1$s \n Latitude: %2$s",
                                location.getLongitude(), location.getLatitude()
                );
                Toast.makeText(GPSLocator.this, message,
                                Toast.LENGTH_LONG).show();
        }

}   
</code></pre>

<p>After compiling the code when i give any character and click on the sent button then a message is displayed on the screen like "The application GPSLocator(process com.vetexVervelnc GPSLocator) has stopped unexpectedly. Please try again   Forse close  " </p>
