title: Creating a blank location object
body: <p>A couple of other people and me are working on an app for android. It requires locating the device in latitude and longitude. We've been able to create a location object, but the object is always blank. We even tried recreating the code in a completely empty project, but that also failed. Here's our root activity:</p>
  
  <pre><code>package com.app.Locationtest;
  
  import android.app.Activity;
  import android.content.Context;
  import android.location.Location;
  import android.location.LocationManager;
  import android.os.Bundle;
  
  public class locationtest extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          LocationManager locman =(LocationManager)getSystemService(Context.LOCATION_SERVICE); 
          Location loc = locman.getLastKnownLocation(LocationManager.GPS_PROVIDER);
          if (loc==null)
          {
             finish();
          }
      }
  }
  </code></pre>
  
  <p>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.app.Locationtest"
        android:versionCode="1"
        android:versionName="1.0"&gt;
        &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
        &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
        &lt;uses-permission android:name="android.permission.ACCESS_GPS" /&gt;
      &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
          &lt;activity android:name=".locationtest"
                    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;uses-sdk android:minSdkVersion="8" /&gt;
  
  &lt;/manifest&gt; 
  </code></pre>
  
  <p>How do we fix this problem?</p>