Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 require 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");

like image 288
user536847 Avatar asked Dec 09 '10 18:12

user536847


People also ask

What is dialog in Android?

A dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout. A dialog with a pre-defined UI that allows the user to select a date or time. Caution: Android includes another dialog class called ProgressDialog that shows a dialog with a progress bar.

Why is progressdialog deprecated in Android?

Caution: Android includes another dialog class called ProgressDialog that shows a dialog with a progress bar. This widget is deprecated because it prevents users from interacting with the app while progress is being displayed.

How do I show a dialogfragment in Android?

When you want to show your dialog, create an instance of your DialogFragment and call show (), passing the FragmentManager and a tag name for the dialog fragment. You can get the FragmentManager by calling getSupportFragmentManager () from the FragmentActivity or getFragmentManager () from a Fragment. For example:

How to build an alertdialog in Android?

To build an AlertDialog: // 1. Instantiate an <code><a href="/reference/android/app/AlertDialog.Builder.html">AlertDialog.Builder</a></code> with its constructor // 2. Chain together various setter methods to set the dialog characteristics // 3.


1 Answers

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);
like image 127
diyism Avatar answered Sep 27 '22 19:09

diyism