I receive the error on the line below:
AlertDialog.Builder alrtDialog = new AlertDialog.Builder(this);
The Error show is :
AlertDialog.Builder cannot be resolved to a type
I import the following for this:
import android.content.DialogInterface;
the java code in the example(from android programming unleashed) includes android.app.AlertDialog but importing this results in message: conflicts with a type defined in the same file
java file to add alert dialog code to launch the dialog. Modify layout XML file res/layout/activity_main. xml add any GUI component if required. Run the application and choose a running android device and install the application on it and verify the results.
A dialog is a small window that prompts the user to make a decision or enter additional information. A dialog does not fill the screen and is normally used for modal events that require users to take an action before they can proceed. Dialog Design.
You have to import this
import android.app.AlertDialog.Builder
Try to import
import android.app.AlertDialog;
and also if your using this line AlertDialogManager alert = new AlertDialogManager();
remove it and try.
first check that you have import the corresponding package
import android.app.AlertDialog;
and then c
check that you are using your activity instance
AlertDialog.Builder alert = new AlertDialog.Builder(yourActivityname.this);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With