Android 接近警报-启动活动

Android 接近警报-启动活动,android,locationmanager,android-pendingintent,Android,Locationmanager,Android Pendingintent,我正在使用接近警报启动一项活动 我在支持GPS的Android 2.3仿真器上使用了它,但重启电脑后,它就不再工作了。不确定这是不是因为日食 我必须在我的代码中丢失某些内容或将其破坏,现在无法看到它: private LocationManager locationManager; private PendingIntent pendingIntent; double lat = 33.426517; double lon = -70.439244; float radius = 1000f;

我正在使用接近警报启动一项活动

我在支持GPS的Android 2.3仿真器上使用了它,但重启电脑后,它就不再工作了。不确定这是不是因为日食

我必须在我的代码中丢失某些内容或将其破坏,现在无法看到它:

private LocationManager locationManager;
private PendingIntent pendingIntent;
double lat = 33.426517;
double lon = -70.439244;
float radius = 1000f;
long expiration = -1;

 @Override
        public void onCreate(Bundle savedInstanceState) {
    /* Instantiate MapView, ZoomControls, layout, etc. here
    */
    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    locationManager.addProximityAlert(lat, lon, radius, expiration,
            pendingIntent);

    Intent newActivity = new Intent(this, InfoActivity.class);
    pendingIntent = PendingIntent.getActivity(this, 0, newActivity, 0);

    }