Added a null check on mIntent before trying to access it's information

closes #87

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-05-29 16:48:14 -04:00
parent b34bf29302
commit b211c3d829

View File

@@ -177,12 +177,14 @@ public class SkyHookService extends Service implements GeoPointLocationListener,
this.mIntent = intent;
if(intent != null){
if (intent.hasExtra(INTENT_EXTRA_PERIOD_BETWEEN_UPDATES))
mPeriod = intent.getLongExtra(INTENT_EXTRA_PERIOD_BETWEEN_UPDATES, 60000L);
if (intent.hasExtra(INTENT_EXTRA_REQUIRED_ACCURACY))
mRequiredAccuracy = intent.getIntExtra(INTENT_EXTRA_REQUIRED_ACCURACY, -1);
}
}
/**
* registers our Receiver the starts the service with the alarm manager