vendredi 23 janvier 2015

Null Pointer Exception while applying conditions

This is a small portion of my code.While running it shows "Unfortunately application is stop".Logcat shows a Null Pointer Exception. if "if-else" condition is not used it execute smoothly. In this case i can't check whether gps is ON/OFF.



public void runGPSFunction() {
if(gps.canGetLocation())
{


sendSMS.sendSMSMessage();
}
else
{
gps.showSettingsAlert();
}


Please help me to solve this.


Aucun commentaire:

Enregistrer un commentaire