title: How to make this location finder (GPS) on android works?
body: <p>i was made an finding location application that show a latitude and longitude in the textview.. here's my code :</p>
  
  <pre><code>package com.application.geocoding;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.content.Context;
  import android.location.Location;
  import android.location.LocationManager;
  import android.widget.TextView;
  
  public class main extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          LocationManager locationManager;
          String context = Context.LOCATION_SERVICE;
          locationManager = (LocationManager)getSystemService(context);
  
          String provider = LocationManager.GPS_PROVIDER;
          Location location = 
            locationManager.getLastKnownLocation(provider);
  
          updateWithNewLocation(location);
      }
  
      private void updateWithNewLocation(Location location) {
          String latLongString;
          TextView myLocationText; 
          myLocationText=(TextView)findViewById(R.id.textView1);
  
          if (location != null) {
            double lat = location.getLatitude();
            double lng = location.getLongitude();
            latLongString = "Lat:" + lat + "\nLong:" + lng;
          } else {
            latLongString = "No location found"; 
          }
          myLocationText.setText("Your Current Position is:\n" + 
                                 latLongString);
      }
  }
  </code></pre>
  
  <p>and here's the manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.application.geocoding"
        android:versionCode="1"
        android:versionName="1.0"&gt;
      &lt;uses-sdk android:minSdkVersion="8" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
  
      &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
          &lt;activity android:name=".main"
                    android:label="@string/app_name"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>that code is still not works and only can display "No location found" textview.. has anyone know how to solve that problem?? thanks..</p>