title: EditText in GridView get Data and into an array
body: <p>I want to display several edit texts in a grid view.
   `package       com.devan.test1;</p>
  
  <pre><code>import android.content.Context;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.BaseAdapter;
  import android.widget.EditText;
  
  
  public class CustomGrid extends BaseAdapter {
  private final String[] web;
  View grid;
  private Context mContext;
  
  public CustomGrid(Context c, String[] web) {
      mContext = c;
  
      this.web = web;
  }
  
  
  
  @Override
  public int getCount() {
      // TODO Auto-generated method stub
      return web.length;
  }
  
  @Override
  public Object getItem(int position) {
      // TODO Auto-generated method stub
      return null;
  }
  
  @Override
  public long getItemId(int position) {
      // TODO Auto-generated method stub
      return 0;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      // TODO Auto-generated method stub
  
      LayoutInflater inflater = (LayoutInflater) mContext
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      if (convertView == null) {
  
          grid = new View(mContext);
          grid = inflater.inflate(R.layout.grid_single, null);
          EditText textView = (EditText) grid.findViewById(R.id.grid_text);
  
  
      } else {
          grid = convertView;
      }
  
      return grid;
  }
  }`
  </code></pre>
  
  <p>The adapter which I made works but what I don't know is how to get data from several edit texts and store into an array.<br>
  Regards Devan<br>
  <strong>Update</strong><br>
  MainActivtiy.java</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.Button;
  import android.widget.GridView;
  import android.widget.Toast;
  
  public class MainActivity extends Activity {
  GridView grid;
  String[] web = {
          "Google",
          "Github",
          "Instagram",
          "Facebook",
          "Flickr",
          "Pinterest",
          "Quora",
          "Twitter",
          "Vimeo",
          "WordPress",
          "Youtube",
          "Stumbleupon",
          "SoundCloud",
          "Reddit",
          "Blogger"
  
  };
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      final CustomGrid adapter = new CustomGrid(MainActivity.this, web);
      grid = (GridView) findViewById(R.id.grid);
      grid.setAdapter(adapter);
      grid.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                  int position, long id) {
              Toast.makeText(MainActivity.this, "You Clicked at " + web[+position], Toast.LENGTH_SHORT).show();
  
          }
      });
      Button b1=(Button) findViewById(R.id.button1);
      b1.setOnClickListener(new View.OnClickListener()
      {
          @Override
          public  void onClick(View v)
          {
              Intent i =new Intent(getApplicationContext(),Main2Activity.class);
              i.putExtra("l",adapter.getBundle());
              startActivity(i);
          }
      });
  
  }
  
  }
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".MainActivity"&gt;
  
  &lt;GridView
      android:id="@+id/grid"
      android:layout_width="fill_parent"
      android:layout_height="450dp"
      android:columnWidth="100dp"
      android:gravity="center"
      android:numColumns="auto_fit"
      android:stretchMode="columnWidth" /&gt;
  &lt;Button
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_below="@+id/grid"
      android:id="@+id/button1"
      /&gt;
  
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".MainActivity"&gt;
  
  &lt;GridView
      android:id="@+id/grid"
      android:layout_width="fill_parent"
      android:layout_height="450dp"
      android:columnWidth="100dp"
      android:gravity="center"
      android:numColumns="auto_fit"
      android:stretchMode="columnWidth" /&gt;
  &lt;Button
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_below="@+id/grid"
      android:id="@+id/button1"
      /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Main2Activity.java</p>
  
  <pre><code>import android.support.v7.app.AppCompatActivity;
   import android.os.Bundle;
   import android.widget.TextView;
  
   public class Main2Activity extends AppCompatActivity {
  
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main2);
      TextView t=(TextView) findViewById(R.id.tc1);
      t.setText(getIntent().getStringExtra("l"));
  }
  }
  </code></pre>
  
  <p>activity_main2.xml</p>
  
  <pre><code>&lt;android.support.constraint.ConstraintLayout   xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="com.devan.test1.Main2Activity"&gt;
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/tc1"
      /&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>grid_single.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:padding="5dp"&gt;
  
  
  &lt;EditText
      android:id="@+id/grid_text"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="15dp"
      android:textSize="15sp" /&gt;
  
  
     &lt;/LinearLayout&gt;
  </code></pre>