title: customization array adapter to add edittext values to ListView
body: <p>in my main activity there are tow edit texts one for student name and one for student college, also there is an Add student button, as the following code the onClick function for the Add student button will insert the values of the edit texts to a list view :</p>
  
  <pre><code>public class Students extends AppCompatActivity {
  
  //Initializing ...
  EditText NameEditText;
  EditText CollegeEditText;
  Button AddButton;
  ListView StudentListView;
  ArrayList&lt;Student&gt; list;
  ArrayAdapter&lt;Student&gt; adapter;
  Random rand = new Random();
  @Override
  protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_students);
  </code></pre>
  
  <p>//Getting references ...</p>
  
  <pre><code>AddButton=(Button) findViewById(R.id.AddBtn);
  NameEditText=(EditText) findViewById(R.id.StudentName);
  CollegeEditText=(EditText) findViewById(R.id.College);
  StudentListView=(ListView) findViewById(R.id.StudentListView);
  
  //define the array list of students  .
  list=new ArrayList&lt;Student&gt;();
  
  //set the communication between the ArrayList and the adapter.
  
  
  
  adapter=new ArrayAdapter&lt;Student&gt;(this,android.R.layout.simple_list_item_1,list);
  //set the communication between the Adapter and the ListView.
  
  
  
      StudentListView.setAdapter(adapter);
  
  OnClickListener listener=new OnClickListener() {
      @Override
      public void onClick(View v) {
          int ID=rand.nextInt(50) + 1;
          Student student=new Student();
          student.setID(ID);
          student.setName(NameEditText.getText().toString());
          student.setCollege(CollegeEditText.getText().toString());
  
          list.add(student);
          NameEditText.setText("");
          CollegeEditText.setText("");
          adapter.notifyDataSetChanged();
      }
  };
      AddButton.setOnClickListener(listener);
  
  }}
  </code></pre>
  
  <p>As you can see I've created a student class and list of student and used Array adapter to add the values to the ListView.</p>
  
  <p>What I really want is to custom my ListView so each row of the list view would look like this</p>
  
  <p><a href="https://i.stack.imgur.com/cLKHf.jpg" rel="nofollow noreferrer">ListViewRow.xml</a></p>
  
  <p>So i'm customizing the Array Adapter class to Student Array Adapter as the following code :</p>
  
  <pre><code>class StudentAdapter extends ArrayAdapter &lt;Student&gt;{
  
  public Context context;
  public List&lt;Student&gt;students;
  
  
  
  
  public StudentAdapter(@NonNull Context context, List&lt;Student&gt; list) {
      super(context,R.layout.student_row, list);
      this.context=context;
      this.students=list;
  
  }
  
  @NonNull
  @Override
  public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
  
      LayoutInflater inflater = (LayoutInflater) context
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View rowView = inflater.inflate(R.layout.student_row, parent, false);
      TextView name = (TextView) rowView.findViewById(R.id.Name);
      TextView college = (TextView) rowView.findViewById(R.id.College);
  </code></pre>
  
  <p>//what to do next???</p>
  
  <pre><code>}
  </code></pre>
  
  <p>}</p>
  
  <p>I want to set the value of each Text View in the Student Row 
  how can I complete my student Adapter?</p>