0

How can I activate my application when a user open the message inbox in android. I can open the inbox from my application . I need a vice verse where open my app when message is opened.

K.Muthu
  • 1,232
  • 1
  • 17
  • 38

1 Answers1

1

I've never done that, but I suppose you can do a background process that check periodically (not too often though ;) ) the status of unread messages. When the user read the message you show up a notification.

final Uri SMS_INBOX = Uri.parse("content://sms/inbox");
Cursor c = getContentResolver().query(SMS_INBOX, null, "read = 0", null, null);
int unreadMessagesCount = c.getCount();
c.deactivate();
Philippe
  • 103
  • 1
  • 7