take a look at the following code:
- Code: Select all
package com.android.test;
import com.google.android.maps.GeoPoint;
import android.app.Activity;
import android.os.Bundle;
import android.widget.Toast;
public class test extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setGeoPoint();
}
private GeoPoint[] station_geo;
private void setGeoPoint() {
try {
station_geo[0] = new GeoPoint((int) (39.902420 * 1000000),
(int) (116.425728 * 1000000));
station_geo[1] = new GeoPoint((int) (39.895458 * 1000000),
(int) (116.321274 * 1000000));
}
catch (Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
}
}
}
when i run this app on the android emulator, an alertdialog occurred 'the application test has stopped unexceptedly. please try again.' as a rookie in android dev, i don't quite catch it. what's the problem here? thanks for ur help!


