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.
Asked
Active
Viewed 1,634 times
1 Answers
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
-
i want do like a sms lock app – K.Muthu Apr 05 '12 at 10:36
-
Do you mean, prevent the user from accessing his messages (like if he doesn't provide a password)? – Philippe Apr 05 '12 at 11:15
-
Well, I haven't any idea on how to do this... Sorry I couldn't help you more that that. – Philippe Apr 05 '12 at 11:41