AlertDialog was added in API Level 1
1. In the MainActivity.java file, add the below import to the imports section.
import android.app.AlertDialog.Builder;
2. In the dialog method you created in your class add the below line. This creates an AlertDialog Builder named myAlertDialogBuilder.
AlertDialog.Builder myAlertDialogBuilder;
3. Compile and run!
Next Recommended Article: How to Instantiate a new AlertDialog.Builder
Resources:
http://developer.android.com/reference/android/app/AlertDialog.Builder.html
Popular Posts
- Cursor getColumnIndex - Get the Index for a Column Name
- Solution: error: Error parsing XML: unbound prefix
- How to Determine if Android Device has GSM Telephony
- setVisibility() - Hide a Button, in Java
- Save LogCat to a Text File
- android:ems
- How to Get the Latitude
- Change the line spacing between lines of text in an TextView/EditText, using lineSpacingMultiplier
- android:ellipsize - Make a Scrolling Marquee, using scrollHorizontally, in a TextView
- Intent setType(String type) - How to Set an Explicit MIME data type