Android Community
Results 1 to 1 of 1

Thread: Dialog coding error

  1. #1
    Join Date
    Dec 2011
    Location
    PAKISTAN
    Posts
    2

    Question Dialog coding error


    First I wrote all this code from book name beginning android application development
    but still error then I copied from 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();
    }
    })
    Last edited by yazi; 12-13-2011 at 12:06 PM.

Similar Threads

  1. Replies: 0
    Last Post: 09-02-2011, 01:13 AM
  2. Variable Passing through Methods coding question
    By sflmetalhead in forum Developers Guild
    Replies: 2
    Last Post: 07-14-2011, 01:39 PM
  3. Creating an Alert dialog in a Dialog
    By sandhya in forum Developers Guild
    Replies: 3
    Last Post: 04-15-2010, 12:46 AM
  4. Sample Coding----Mystiqe
    By SkippyMigee in forum Developers Guild
    Replies: 0
    Last Post: 11-11-2009, 03:48 PM
  5. Need help in coding a theme
    By gpo1 in forum Developers Guild
    Replies: 14
    Last Post: 01-16-2009, 10:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •