android - Intent putExtra is not working -
i writing 1 test application keystring
in 1 module writing intent , broadcasting
broadcasting part:
intent broadcastintent = new intent("android.intent.action.my_action"); broadcastintent.putextra("my_key_code", "*#1234589*#"); context.sendbroadcast(broadcastintent);
in receiver want string, getting error my_key_code not defined.
receiver part:
if (intent != null && intent.getaction().equals("android.intent.action.my_action")) { if (intent.getstringextra("my_key_code") .equals(context.getstring("*#1234589*#")))
can 1 regarding this
i guess want enter if condition when value equal *#1234589*#
. if case if condition wrong
lets try this
string xxx = intent.getstringextra("my_key_code"); if (xxx.equals("*#1234589*#")){ }
Comments
Post a Comment