1

I am developing the app which holds the messages in it's own inbox rather than the native inbox.

This can be achieved only if the incoming messages are prevented from reaching the native inbox.

There is some attribute android:priority in <intent-filter>, by which message can be first received by current receiver than others.

But I do not know how to do it properly, does anyone know?

JoseK
  • 31,141
  • 14
  • 104
  • 131
Sujal Patel
  • 63
  • 1
  • 7

1 Answers1

1

I assume you mean SMS messages? The best, and only AFAIK, is to receive the message via registering the proper BroadcastReceiver object, copying the message into your database, marking it is read in the SMS ContentProvider and then deleting it from the SMS ContentProvider. Check out this article on how to receive SMS messages and then check out this SO post on how to use the SMS content provider.

Edit I actually stand corrected, there is another method that I've had sometimes limited success with. In the BroadcastReceiver you can call the abortBroadcast() method to cancel the broadcast. The important thing here is that you register your receiver with an intent filter that has a higher priority (say, 100) so that it receives the SMS before anybody else does.

Community
  • 1
  • 1
Chris Thompson
  • 35,167
  • 12
  • 80
  • 109