Failing to link button to intent
<p>When i try this code which reads what the user has clicked and compares it to the button name it only seems to work for one array rather then the 2nd one. If anybody can see why please help me        </p>

<pre><code>        case R.id.new_button:
        final CharSequence[] items = {"N", "E", "M", "G"};

        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("Pick a difficulty");
        builder.setItems(items, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int item) {

            if ("N".equals(items[0]))
            {Intent intent = new Intent();
            Intent i0 = new Intent(B.this, Test1.class);

            startActivity(i0);}
            else if ("M".equals(items[2]))
            {Intent intent = new Intent();
            Intent i2 = new Intent(Brain.this, Test2.class);

            startActivity(i2);;}


        }

        }).show();
        AlertDialog alert = builder.create();
</code></pre>
