开发者

Android : How to avoid complete action using Dialog

I have made Qr code Scanner using Intent using Zxing library and i have kept Library in application so that my app no longer r开发者_开发知识库equire barcode scanner. But When barcode scanner is already in operating system, when i start my application , a dialog box appear asking complete action using : barcode scanner or My application . When I have all library in my own application Then how can i avoid this Dialog Box. Please help me out.

Example code :

Intent in = new intent("com.google.zxing.android.SCAN");


To use:

Intent intent=new Intent("com.google.zxing.client.android.SCAN");
intent.setClassName("com.google.zxing.client.android", "com.google.zxing.client.android.CaptureActivity");
startActivityForResult(intent, 0);

Or:

Intent intent=new Intent("com.google.zxing.client.android.SCAN");
intent.setClassName(this, "com.google.zxing.client.android.CaptureActivity");
startActivityForResult(intent, 0);


Better still is to use the IntentIntegrator class provided by the project: http://code.google.com/p/zxing/wiki/ScanningViaIntent

This takes care of more cases (like the app not being installed) than just making your own Intent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜