Android Programming Press on the image to return to the main documentation page.

BroadCastReceiver

Written by XverhelstX

List of types:

BroadCastReceiver

BroadCastReceiver


Permissions:

android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_NETWORK_STATE
android.permission.CHANGE_NETWORK_STATE
android.permission.ACCESS_COARSE_UPDATES
android.permission.READ_PHONE_STATE

Events:

None

Members:


  AbortBroadcast

  addAction (Action As String)

  addCategory (Category As String)

  deleteMessage

  Initialize (EventName As String)

  isOrderedBroadcast As Boolean

  isRegistered As Boolean

  registerReceiver (Action As String)

  ResultCode As Int [read only]

  ResultData As String [read only]

  sendBroadcast (Action As String)

  sendOrderedBroadcast (Action As String, receiverPermission As String)

  SetPriority (Priority As Int)

  SMS_RECEIVED As String

  unregisterReceiver

Members description:

AbortBroadcast
Sets the flag indicating that this receiver should abort the current broadcast; only works with broadcasts sent through
sendOrderedBroadcast. This will prevent any other broadcast receivers from receiving the broadcast.
It will still call onReceive() of the BroadcastReceiver that the caller of sendOrderedBroadcast passed in.
This method does not work with non-ordered broadcasts such as those sent with sendBroadcast
addAction (Action As String)
The intent to listen for.
Action: the Intent to listen for.
addCategory (Category As String)
Adds a category to the receiver
Category:
deleteMessage
Deletes the whole conversation of the first message.
You can call this anytime, when a new message arrives or with onReceive.
Note that if you call AbortBroadcast with a higher priority than your message application, the message won't show too.
Initialize (EventName As String)
Initializes the BroadcastReceiver.
EventName - Events subs prefix.
isOrderedBroadcast As Boolean
checks if it's an ordered broadcast.
Return type: @return:
isRegistered As Boolean
Returns a boolean that shows if the receiver is registered.
Return type: @return:
registerReceiver (Action As String)
Registers a Broadcast Receiver.
Action: the intent to listen for.
GoAsync: Allow it to keep the broadcast active after returning from onreceive
Action:
ResultCode As Int [read only]
Retrieve the current result code, as set by the previous receiver.
ResultData As String [read only]
Retrieve the current result data, as set by the previous receiver.
sendBroadcast (Action As String)
Sends a broadcast with the intent Action.
Action:
sendOrderedBroadcast (Action As String, receiverPermission As String)
Broadcast the given intent to all interested BroadcastReceivers,
delivering them one at a time to allow more preferred receivers to consume the broadcast before it
is delivered to less preferred receivers. This call is asynchronous; it returns immediately, and you
will continue executing while the receivers are run.
Action: The Intent to broadcast; all receivers matching this Intent will receive the broadcast.
Action: receiverPermission (optional) String naming a permissions that a receiver must hold in order to receive your broadcast. If null, no permission is required.
SetPriority (Priority As Int)
Sets the priority.
The higher the value, the more important the receiver will be thus the first it will be called.
max: 2147483647
rec: 999 to -999
Priority:
SMS_RECEIVED As String
unregisterReceiver
Unregisters the current Broadcast Receiver.
Top