Getting data from EditText fields
<p>I have created a custom <code>AlertDialog</code> with multiple <code>EditText</code> fields using a custom layout. Now the problem is  don't know how to get data from these <code>EditText</code> when user clicks. Here's the <strong><code>AlertDialog</code></strong>.</p>

<pre><code>    case R.id.menu_newitem:
        LayoutInflater factory = LayoutInflater.from(this);
        final View textEntryView = factory.inflate(R.layout.newvslayout, null);
        new AlertDialog.Builder(this).setTitle("New VS")
                .setView(textEntryView).setPositiveButton("Ok", new DialogInterface.OnClickListener(){
                    public void onClick(DialogInterface dialog, int whichButton) {

                        /* User clicked OK so do some stuff */
                    }
                }).setNeutralButton("Cancel", new DialogInterface.OnClickListener(){
                    public void onClick(DialogInterface dialog, int whichButton) {

                        /* User clicked cancel so do some stuff */
                    }
                }).show();
</code></pre>

<p>And this is my layout <strong>newvslayout.xml</strong></p>

<pre><code>....
....
&lt;EditText android:id="@+id/vsname" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:text="Name"
    android:inputType="text" /&gt;

&lt;EditText android:id="@+id/csize" android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
            android:text="100" 
    android:inputType="number" /&gt;

&lt;EditText android:id="@+id/dsize" android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:text="600" android:inputType="number" /&gt;

&lt;EditText android:id="@+id/ssize" android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="200" android:inputType="number" /&gt;
....
....
</code></pre>
