I am getting this error: ShowDialog cannot be resolved to a type
Here is my code:
final CharSequence[] items = {"Low", "Medium", "High"};
AlertDialog.Builder builder = new AlertDialog.Builder(ShowDialog.this);
builder.setTitle("Alert Dialog with ListView");
builder.setIcon(R.drawable.image1);
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
}
});
AlertDialog alert = builder.create();
alert.show();
Any ideas why I am getting this annoying error? I have tried to refresh my code and also clean it and still no luck. Thanks
.
stackoverflow.comm
No comments:
Post a Comment