views:

30

answers:

1

I have a service setup to receive a PACKAGE_ADDED and a PACKAGE_REMOVED intent from all <data android:scheme="package" />

I receive the intent correctly, but I need to know how to use the Intent and Context classes from onReceive to get the name and label of the application that was added or removed.

I have been able to use Intent.getDataString() to get the uri string of the package, but don't really know where to go from there.

Thanks.

A: 

I don't know what the Uri looks like. I would assume it contains the package name (e.g., com.commonsware.my.really.awesome.app). If so, you can use PackageManager to get the rest of the details regarding that application.

CommonsWare
Yeah, I need to use PackageManager. I can't use it in the BroadcastReceiver but rather need to figure out how to send it to a Service the receiver is starting.
prodaea