Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7677321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:23:47+00:00 2026-05-31T17:23:47+00:00

I’m developing a simple voice recognizer using the service offered by Android and reading

  • 0

I’m developing a simple voice recognizer using the service offered by Android and reading the speech input article on Android Developers website. This article shows the following code:

PackageManager pm = getPackageManager();
List<ResolveInfo> activities = pm.queryIntentActivities(
  new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);

...

The second argument of queryIntentActivities method is an int flag. If I understand it, this flag is used to add additional search options: in this case, what options are available for searching the specified Intent?

Why does the flag specified in the example is set to zero?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:23:48+00:00Added an answer on May 31, 2026 at 5:23 pm

    This should be filed as an SDK documentation issue in the Android Issue Mgmt System. I’ve had the same question. PackageManager is an abstract class and its subclasses ultimately end up calling the system service called “PackageManagerService” which implements the logic for #queryIntentActivities(Intent, int).

    Until the documentation is improved the answer can be found in the source, for example the 1.5r4 source at http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/com/android/server/PackageManagerService.java#PackageManagerService.Settings.isEnabledLP%28android.content.pm.ComponentInfo%2Cint%29.

    Why does the flag specified in the example is set to zero?

    The “0” flag is very likely a remnant of some example/reference code that has been copied perpetually. The code at PackageManagerService isn’t easy to follow. It looks like com.android.server.IntentResolver#queryIntent(…) eventually gets called during the resolution process. This method’s callers are only concerned with the bit-value of the MATCH_DEFAULT_ONLY flag. Keep in mind that Intent flags can be OR’ed and AND’ed. What I’m trying to say is that #queryIntent(…) ultimately sees whether MATCH_DEFAULT_ONLY’s bit value is set or not.

    in this case, what options are available for searching the specified Intent?

    In the current state of affairs it’s difficult to say with full confidence which flags actually work and how they work without significant experimentation and code analysis. I can say that PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, and PackageManager.COMPONENT_ENABLED_STATE_DISABLED are used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.