JMTron
JMTron

Reputation: 65

What is the difference between Context.sendBroadcastAsUser and Context.startActivity?

What does UserHandle, included in the arguments for sendBroadcastAsUser, add and how does it change how the system handles the intent?

Upvotes: 0

Views: 2363

Answers (1)

Prem
Prem

Reputation: 4831

SendBroadcastAsUser(Intent intent, UserHandle user, string receiverPermission);

  1. Version of sendBroadcast(Intent, String) that allows you to specify the user the broadcast will be sent to.
  2. This is not available to applications that are not pre-installed on the system image. Using it requires holding the INTERACT_ACROSS_USERS permission.sendBroadcast(Intent, String) Version Information
  3. Supported after Android v4.2

Context.startActivity

Used to start a different activity.

Upvotes: 1

Related Questions