Unable to get the Values in a ListButtonDialog box with multi choice items in android
<p>I have small doubt is that I am showing a ListButtonDialog box with multi choice itmes on button click event in android.
Every thing is fine like I can see the Title and Message I set for the ListDialog and a button also.</p>

<p>but I am unable to see the actual values that are added as multi choice items.</p>

<p>here is my code.</p>

<pre><code>   final Button btn1=(Button) findViewById(R.id.btnToggle);
            btn1.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    InputMethodManager inmgr=(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                    inmgr.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
                }
            });

            btn=(Button) findViewById(R.id.btnMultiChoice);
            btn.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v)
                {
                    // TODO Auto-generated method stub
        Toast.makeText(getApplicationContext(), "Hello World",Toast.LENGTH_LONG).show();
                    MultiSelectDialog();
                }
            });




              private void MultiSelectDialog()
    {
        try
        {

            final String[] Values={"Red","Green","Blue"};

final CharSequence[] Crayons={"Red","Green","Blue","Orange","Yellow"};

            final boolean[] selCrayons={true,false,true};

            AlertDialog.Builder dialog=new AlertDialog.Builder(this);

            dialog.setTitle("Crayons List");

            dialog.setMessage("Select your favouriate Crayon");

            try

            {


         dialog.setMultiChoiceItems(Values,selCrayons,new 
          DialogInterface.OnMultiChoiceClickListener()
          {
    @Override
        public void onClick(DialogInterface arg0, int arg1, boolean arg2)
    {
    if(arg2)
        {
                                                                          Toast.makeText(getApplicationContext(), "Selected Color is " +                           Crayons[arg1].toString(),Toast.LENGTH_LONG).show();
                }
            }
    });

      dialog.setPositiveButton("SAVE",new DialogInterface.OnClickListener() {
            @Override
    public void onClick(DialogInterface dialog, int which) {            
    }
    });
    AlertDialog alertDialog=dialog.create();
        alertDialog.show();
    }
    catch(Exception ex)
    {
    TextView tv=(TextView) findViewById(R.id.textView1);
    tv.setText(ex.toString());
    Toast.makeText(getApplicationContext(),ex.toString() + ex.getMessage(),Toast.LENGTH_LONG).show();
    }
    }
    catch(Exception ex)
    {
    TextView tv=(TextView) findViewById(R.id.textView1);
    tv.setText(ex.toString());
    Toast.makeText(getApplicationContext(),ex.toString() + ex.getMessage(),Toast.LENGTH_LONG).show();
        }
    }
}
</code></pre>
