Книга: Beginning Android

Asking Around

Asking Around

Both the ActivityAdapter family and addIntentOptions() use queryIntentActivityOptions() for the “heavy lifting” of finding possible actions. The queryIntentActivityOptions() method is implemented on PackageManager, which is available to your activity via getPackageManager().

The queryIntentActivityOptions() method takes some of the same parameters as does addIntentOptions(), notably the caller ComponentName, the “specifics” array of Intent instances, the overall Intent representing the actions you are seeking, and the set of flags. It returns a List of Intent instances matching the stated criteria, with the “specifics” ones first.

If you would like to offer alternative actions to users, but by means other than addIntentOptions(), you could call queryIntentActivityOptions(), get the Intent instances, then use them to populate some other user interface (e.g., a toolbar).

Оглавление книги

Оглавление статьи/книги

Генерация: 0.031. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз