PDA

View Full Version : Dialog coding error



yazi
12-13-2011, 12:03 PM
First I wrote all this code from book name beginning android application development
but still error then I copied from www.wrox.com (http://www.wrox.com/) still same error and I made that word
bold so please guide me...

@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case 0:
return new AlertDialog.Builder(this)
.setIcon(R.drawable.icon) //getting error here on "icon"
.setTitle("This is a dialog with some simple text...")
.setPositiveButton("OK", new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton)
{
Toast.makeText(getBaseContext(),
"OK clicked!", Toast.LENGTH_SHORT).show();
}
})