Android - error when try to test GPS on Emulator
<p>i wanna test a simple brief of using GPS on android. so i write a simple code like this :</p>

<pre><code>public class main extends Activity{
LocationManager mLocationManager;
TextView tv;
public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    tv = (TextView)findViewById(R.id.myLocationText);
    mLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);

    Criteria criteria = new Criteria();
    criteria.setAccuracy(Criteria.ACCURACY_FINE);
    criteria.setPowerRequirement(Criteria.POWER_LOW);
    String locationprovider = mLocationManager.getBestProvider(criteria, true);
    Location mLocation = mLocationManager.getLastKnownLocation(locationprovider);

    tv.setText("Last location lat:" + mLocation.getLatitude() + "long:" + mLocation.getLongitude());
}
</code></pre>

<p>}</p>

<p>also, on AndroidManifest i added uses-permission like this :</p>

<pre><code>    &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
&lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
</code></pre>

<p>but when i try to run at android emulator i get Error "Stopped Unexpectedly" and this apps closed. i added some try with DDMS too. but i dont have any idea about this error.</p>
