I am creating a op-out app. I am using Incomming SMS Broadcast Receiver, I need to check if the incoming message contains a specific keyword:
i.e
From: 656565451
msn: I want to op-out news
code .i.e - "this does not work"
String senderNum = phoneNumber;
String message = currentMessage.getDisplayMessageBody();
//check if user message has this keywork
String keyWord_code = "op-out";
Pattern pattern = Pattern.compile("op-out");
if (pattern == keyWord_code ) {
//Do the op-out function here
}
else {
//Send message to user
}