how to gettext in edittext to array
<p>How can I get the value of EditText then store it in my array?</p>

<p>This is my full code:</p>

<pre><code>EditText op = (EditText)v.findViewById(R.id.operator);
array=new int [Integer.valueOf(op.getText().toString())];

for (i = 0;i&lt;(array.length+1);i++){
    LayoutInflater inflater = MainActivity.this.getLayoutInflater();
    final View v2=inflater.inflate(R.layout.inputangka, null) ;
    new AlertDialog.Builder(MainActivity.this)
        .setIcon(R.drawable.ic_launcher)
        .setTitle("number of-"+(i-1)+":")
        .setView(v2)
        .setNeutralButton("Ok", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dlg, int sumthin) {
                EditText number = (EditText)v2.findViewById(R.id.number);
                int number1 = Integer.valueOf(number.getText().toString());
                array [i]= number1; //error line
</code></pre>

<p>My error log:</p>

<pre><code>02-05 16:33:31.374: E/AndroidRuntime(431): java.lang.ArrayIndexOutOfBoundsException
</code></pre>

<p>How do I solve this?</p>
