Reputation: 1252
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.
Upvotes: 0
Views: 1663
Reputation: 103
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();
Upvotes: 1