以下是我的示例代码:
public class GeoPointMapNewActivity extends Activity implements GpsStatus.NmeaListener {
private LocationManager mLocationManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.geopointmapnew_layout);
mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
mLocationManager.addNmeaListener(this);
}
@Override
public void onNmeaReceived(long timestamp, String nmea) {
//i have call removeNmeaListener, but this method still be call?
mLocationManager.removeNmeaListener(this);
}
@Override
protected void onResume() {
super.onResume();
//******
}
@Override
protected void onStop() {
super.onStop();
//******
}
@Override
protected void onDestroy() {
super.onDestroy();
//*******
}
}