How to force using zxing lib with only my application?

前端 未结 4 1094
抹茶落季
抹茶落季 2020-12-19 20:20

Ok lets say there are 3 different applications which are using zxing lib on the phone. Whenever I want to open zxing with my own application android asks me whether to compl

4条回答
  •  不思量自难忘°
    2020-12-19 20:44

    First, there is no "zxing lib". You are supposed to use the Barcode Scanner application, tying it into your application at the activity level, ideally using their IntentIntegrator code. Here is a sample application demonstrating this. The creators of ZXing specifically do not support or endorse baking the Barcode Scanner source code into another application.

    However, given your symptoms, I have to assume that you are trying to add the Barcode Scanner source code to your own application.

    You presumably have something like this in your manifest on the scanning activity's element:

            
                
    
                
            
    

    You are not Barcode Scanner. Yet, this claims that you are Barcode Scanner.

    You need to remove this , modify your copy of the Barcode Scanner source code to not require it, and then start up the scanning activity using the component-based Intent constructor (e.g., new Intent(this, ThisIsYourRevisedScanningActivity.class)).

提交回复
热议问题