title: No data appears on my listview with custom adapter sql
body: <p>No errors are shown but no data appears on my activity.</p>
  
  <p>I have 6 data items in my sql code: id, name, surname, email, phone number, and password,
  and I made a custom adapter to view all of those in the list view, and I don't know where the error is.</p>
  
  <p><a href="https://i.stack.imgur.com/gnxa1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gnxa1.png" alt="no data appeared"></a></p>
  
  <p>DatabaseHelper.java</p>
  
  <pre><code>    package edu.angelo.parentsportal;
  
      import android.content.ContentValues;
      import android.content.Context;
      import android.database.Cursor;
      import android.database.sqlite.SQLiteDatabase;
      import android.database.sqlite.SQLiteOpenHelper;
  
      import java.util.ArrayList;
  
      public class DatabaseHelper extends SQLiteOpenHelper {
  
  public static final String DATABASE_NAME = "Parents_Portal.db";
  public static final String TABLE_NAME = "Parents_Table";
  public static final String COL_0 = "ID";
  public static final String COL_1 = "NAME";
  public static final String COL_2 = "SURNAME";
  public static final String COL_3 = "EMAIL_ADDRESS";
  public static final String COL_4 = "PHONE_NUMBER";
  public static final String COL_5 = "PASSWORD";
  
  public DatabaseHelper(Context context) {
      super(context, DATABASE_NAME, null, 1);
  
  }
  
  @Override
  public void onCreate(SQLiteDatabase db) {
  db.execSQL("create table " + TABLE_NAME +"(ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT, SURNAME TEXT, EMAIL_ADDRESS TEXT, PHONE_NUMBER TEXT, PASSWORD TEXT)");
  }
  
  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
  db.execSQL("DROP TABLE IF EXISTS "+TABLE_NAME);
  onCreate(db);
  }
  
  public boolean insertData(String name, String surname, String email_address, String phone_number, String password){
      SQLiteDatabase db = this.getWritableDatabase();
      ContentValues contentValues = new ContentValues();
      contentValues.put(COL_1,name);
      contentValues.put(COL_2,surname);
      contentValues.put(COL_3,email_address);
      contentValues.put(COL_4,phone_number);
      contentValues.put(COL_5,password);
      long result = db.insert(TABLE_NAME, null , contentValues);
      if (result == -1) {
          return false;
      }
      else {
          return true;
      }
  }
  
  public Cursor getAllData(){
      SQLiteDatabase db = this.getReadableDatabase();
      Cursor result = db.rawQuery("select * from " +TABLE_NAME,null);
      return result;
  }
  
  
  public ArrayList&lt;ParentModel&gt; getAllParentsData(){
      ArrayList&lt;ParentModel&gt; list = new ArrayList&lt;&gt;();
      String sql = "select * from " + TABLE_NAME;
      SQLiteDatabase mydb = this.getWritableDatabase();
      Cursor cursor = mydb.rawQuery(sql, null);
      if (cursor.moveToFirst()) {
          do {
              ParentModel parentModel = new ParentModel();
              parentModel.setID(cursor.getInt(0));
              parentModel.setName(cursor.getString(1));
              parentModel.setSurname(cursor.getString(2));
              parentModel.setEmail(cursor.getString(3));
              parentModel.setPhone_number(cursor.getString(4));
              parentModel.setPassword(cursor.getString(5));
              list.add(parentModel);
          }
          while (cursor.moveToNext());
      }
      return list;
  }
  }
  </code></pre>
  
  <p>Admin_Parents.java</p>
  
  <pre><code>    package edu.angelo.parentsportal;
  
      import android.content.Intent;
      import android.database.Cursor;
      import android.os.Bundle;
      import android.support.design.widget.FloatingActionButton;
      import android.support.v7.app.AlertDialog;
      import android.view.View;
      import android.support.design.widget.NavigationView;
      import android.support.v4.view.GravityCompat;
      import android.support.v4.widget.DrawerLayout;
      import android.support.v7.app.ActionBarDrawerToggle;
      import android.support.v7.app.AppCompatActivity;
      import android.support.v7.widget.Toolbar;
      import android.view.Menu;
      import android.view.MenuItem;
      import android.widget.ArrayAdapter;
      import android.widget.ListAdapter;
      import android.widget.ListView;
      import android.widget.Toast;
  
      import java.util.ArrayList;
  
      public class Admin_Parents extends AppCompatActivity
      implements NavigationView.OnNavigationItemSelectedListener {
  
  DatabaseHelper mydb;
  ListView listView;
  ArrayList&lt;ParentModel&gt; arrayList;
  CustomAdapter customAdapter;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_admin__parents);
  
      mydb = new DatabaseHelper(this);
      listView = findViewById(R.id.admin_parent_list_view);
      arrayList = new ArrayList&lt;&gt;();
      arrayList = mydb.getAllParentsData();
      customAdapter = new CustomAdapter(this, arrayList);
  
      listView.setAdapter(customAdapter);
  
  
      layoutTools();
      }
  }
  </code></pre>
  
  <p>CustomAdapter.java</p>
  
  <pre><code>package edu.angelo.parentsportal;
  
  import android.app.Activity;
  import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.BaseAdapter;
  import android.widget.TextView;
  
  import java.util.ArrayList;
  import java.util.zip.Inflater;
  
  public class CustomAdapter extends BaseAdapter {
  private Activity activity;
  private ArrayList&lt;ParentModel&gt; items;
  private LayoutInflater inflater;
  
  ParentModel parentModel;
  
  TextView tvid;
  TextView tvname;
  TextView tvsurname;
  TextView tvemail;
  TextView tvphonenumber;
  TextView tvpassword;
  
  public CustomAdapter(Activity activity, ArrayList&lt;ParentModel&gt; items) {
      this.activity = activity;
      this.items = items;
  }
  
  @Override
  public int getCount() {
      return 0;
  }
  
  @Override
  public ParentModel getItem(int position) {
      return items.get(position);
  }
  
  @Override
  public long getItemId(int position) {
      return position;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      if (inflater == null){
          inflater = (LayoutInflater) 
      activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      }
      if (convertView == null){
          convertView = inflater.inflate(R.layout.row, null);
      }
  
      TextView tvid = convertView.findViewById(R.id.tv_id);
      TextView tvname = convertView.findViewById(R.id.tv_name);
      TextView tvsurname = convertView.findViewById(R.id.tv_surname);
      TextView tvemail = convertView.findViewById(R.id.tv_email);
      TextView tvphonenumber = convertView.findViewById(R.id.tv_PhoneNumber);
      TextView tvpassword = convertView.findViewById(R.id.tv_password);
  
      ParentModel parentModel = items.get(position);
      tvid.setText(parentModel.getID());
      tvname.setText(parentModel.getName());
      tvsurname.setText(parentModel.getSurname());
      tvemail.setText(parentModel.getEmail());
      tvphonenumber.setText(parentModel.getPhone_number());
      tvpassword.setText(parentModel.getPassword());
  
  
      return convertView;
      }
  }
  </code></pre>
  
  <p>ParentModel.java</p>
  
  <pre><code>    package edu.angelo.parentsportal;
  
  public class ParentModel {
  public int ID;
  public String Name;
  public String Surname;
  public String Email;
  public String Phone_number;
  public String Password;
  
  public int getID() {
      return ID;
  }
  
  public void setID(int ID) {
      this.ID = ID;
  }
  
  public String getName() {
      return Name;
  }
  
  public void setName(String name) {
      Name = name;
  }
  
  public String getSurname() {
      return Surname;
  }
  
  public void setSurname(String surname) {
      Surname = surname;
  }
  
  public String getEmail() {
      return Email;
  }
  
  public void setEmail(String email) {
      Email = email;
  }
  
  public String getPhone_number() {
      return Phone_number;
  }
  
  public void setPhone_number(String phone_number) {
      Phone_number = phone_number;
  }
  
  public String getPassword() {
      return Password;
  }
  
  public void setPassword(String password) {
      Password = password;
      }
  }
  </code></pre>
  
  <p>Activity_admin__parent.xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v4.widget.DrawerLayout 
  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:id="@+id/drawer_layout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fitsSystemWindows="true"
  tools:openDrawer="start"&gt;
  
  &lt;include
      layout="@layout/app_bar_admin__parents"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  
  &lt;android.support.design.widget.NavigationView
      android:id="@+id/nav_view"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      android:fitsSystemWindows="true"
      app:headerLayout="@layout/admin_nav_header"
      app:menu="@menu/admin_drawer_menu" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>row.xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_margin="10dp"
  android:orientation="vertical"&gt;
  
  &lt;TextView
      android:id="@+id/tv_id"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginBottom="10dp"
      android:text="@string/id" /&gt;
  
  &lt;TextView
      android:id="@+id/tv_name"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginBottom="10dp"
      android:text="@string/name" /&gt;
  
  &lt;TextView
      android:id="@+id/tv_surname"
      android:layout_width="match_parent"
      android:layout_marginBottom="10dp"
      android:layout_height="wrap_content"
      android:text="@string/surname" /&gt;
  
  &lt;TextView
      android:id="@+id/tv_email"
      android:layout_width="match_parent"
      android:layout_marginBottom="10dp"
      android:layout_height="wrap_content"
      android:text="@string/email_address" /&gt;
  
  &lt;TextView
      android:id="@+id/tv_PhoneNumber"
      android:layout_width="match_parent"
      android:layout_marginBottom="10dp"
      android:layout_height="wrap_content"
      android:text="@string/phone_number" /&gt;
  
  &lt;TextView
      android:id="@+id/tv_password"
      android:layout_width="match_parent"
      android:layout_marginBottom="10dp"
      android:layout_height="wrap_content"
      android:text="@string/password" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>