Implicit Broadcasts

2019-07-19 15:30发布

问题:

"Apps that target Android O can no longer register broadcast receivers for implicit broadcasts in their manifest."

ACTION_VIEW is an implicit broadcast.

According to the above statement, one can no longer register as a broadcast receiver for any URI in the manifest. The only way to listen for a URI at this point is if the app is already running?

回答1:

ACTION_VIEW is an implicit broadcast.

Not typically. ACTION_VIEW is used to start an activity, not as a broadcast Intent action.

one can no longer register as a broadcast receiver for any URI in the manifest

Broadcast receivers rarely filter on a Uri (i.e., have <data> elements in their <intent-filter>).