Sunday, April 28, 2013

[android help] Cannot be resolved to a type: Error


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

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...