jeudi 26 février 2015

ResultReceiver.send throws nullpointerexception



I have searched for an answer but I couldn't find one. I am reverse geocoding latitude and latitude in IntentService then when I try to ResultReceiver.send it throws nullpointerexception. I debugged the arguments and they contain the address and the result code just like they are supposed to. I searched on any uninitialized objects but I couldn't fine one. Can anyone give me a clue on what's going on?



private void deliverResultToReceiver(int resultCode, String message) {
Bundle bundle = new Bundle();
try {
if (message != null || "".equals(message))
bundle.putString(Constants.RESULT_DATA_KEY, message);
mReceiver.send(resultCode, bundle);
} catch (NullPointerException npe) {
// TODO Auto-generated catch block
npe.printStackTrace();
}
}



Aucun commentaire:

Enregistrer un commentaire