K.Muthu
K.Muthu

Reputation: 1252

how to access message inbox in android

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

Answers (1)

Philippe
Philippe

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

Related Questions