0

I have developed an application using ZXING library to scan barcodes.

On choosing to scan barcode it asks me to choose the application by which I should scan the barcode.

I want my application to be selected default that it should display the application chooser option.

Her is the attached screenshot Screenshot

WISHY
  • 7,590
  • 21
  • 75
  • 142

3 Answers3

0

I don't know how you prepare Intent for scanning barcode, but it looks like you just add Action to this intent and all Application with that action in intent filter respond.
If you want to run your app, you must specify this in starting intent, for example using this snippet

Edit:
I'm not sure if I get this right - above answer is for situation, where you try to open barcode scanner from your own application.
As MhmdAljobairi said - if you want your app to be deafult barcode scanner for all other applications - it cant be done from code - it's users choice.

Community
  • 1
  • 1
0

you can't do it , its user behaviors Only the user can do it

Muhamet Aljobairi
  • 1,547
  • 3
  • 17
  • 24
0

I have developed an application using ZXING library to scan barcodes.

There is no "ZXING library". There is the Barcode Scanner open source application, whose code you appear to be using.

I want my application to be selected default that it should display the application chooser option.

If you are the one calling startActivityForResult() to scan the barcode, use an explict Intent, one that identifies your barcode-scanning class.

If, instead, you want all apps on the device to use you for barcode scanning, as the other answers have indicated, this is up to the user, not you.

CommonsWare
  • 910,778
  • 176
  • 2,215
  • 2,253