title: Displaying ALL data from sqlite database into listview in tabbed activity
body: <p>As a newcomer to android development I've been stuck on this issue for a few weeks now and it's getting pretty tiring. </p>
  
  <p>After looking at every tutorial and reading every question and answer I could find, still I can't figure out how to get Android Studio to just take what's in my SQLite database and paste its contents into a <code>listview</code>. I would've thought there would be a <code>android:displayallfrom("myDB")</code> command of some kind in the XML files to just display everything there is in a database but it appears to be much more complicated.</p>
  
  <p>Basically, what I want to do is <strong>display ALL data from my database</strong> (<code>Dogs.db</code>) into my <code>listview</code> (<code>list_dogs</code>) in the first tab of my tab view (<code>Tab1</code>).</p>
  
  <p>Here is my code:</p>
  
  <p><strong>Tab1.java</strong></p>
  
  <pre><code>package com.example.major.awoo;
  
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  public class Tab1 extends Fragment {
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.tab1, container, false);
          return rootView;
      }
  }
  </code></pre>
  
  <p><strong>tab1.xml</strong></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"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context="com.example.major.awoo.MainActivity"&gt;
  
      &lt;ListView
          android:id="@+id/list_dogs"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_alignParentBottom="true"
          android:layout_alignParentLeft="true"
          android:layout_alignParentStart="true"
          android:listSelector=""/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>DatabaseHelper.java</strong></p>
  
  <pre><code>package com.example.major.awoo;
  
  import android.content.ContentValues;
  import android.content.Context;
  import android.database.Cursor;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteOpenHelper;
  
  public class DatabaseHelper extends SQLiteOpenHelper {
      public static final String DATABASE_NAME = "Dogs.db";
      public static final String TABLE_NAME = "dogs_table";
      public static final String COL_1 = "ID";
      public static final String COL_2 = "NAME";
      public static final String COL_3 = "AGE";
      public static final String COL_4 = "WEIGHT";
      public static final String COL_5 = "BREED";
  
      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,MARKS INTEGER)");
      }
  
  
      @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 age,String weight,String breed) {
          SQLiteDatabase db = this.getWritableDatabase();
          ContentValues contentValues = new ContentValues();
          contentValues.put(COL_2,name);
          contentValues.put(COL_3,age);
          contentValues.put(COL_4,weight);
          contentValues.put(COL_5,breed);
          long result = db.insert(TABLE_NAME, null, contentValues);
          if(result == -1)
              return false;
          else
              return true;
      }
  
      public Cursor getAllData() {
          SQLiteDatabase db = this.getWritableDatabase();
          Cursor res = db.rawQuery("select * from "+TABLE_NAME,null);
          return res;
      }
  
      public boolean updateData(String id,String name,String age,String weight,String breed) {
          SQLiteDatabase db = this.getWritableDatabase();
          ContentValues contentValues = new ContentValues();
          contentValues.put(COL_1,id);
          contentValues.put(COL_2,name);
          contentValues.put(COL_3,age);
          contentValues.put(COL_4,weight);
          contentValues.put(COL_5,breed);
          db.update(TABLE_NAME, contentValues, "ID = ?",new String[] { id });
          return true;
      }
  
      public Integer deleteData (String id) {
          SQLiteDatabase db = this.getWritableDatabase();
          return db.delete(TABLE_NAME, "ID = ?",new String[] {id});
  
      }
  
      public Cursor getListContents(){
          SQLiteDatabase db = this.getWritableDatabase();
          Cursor data = db.rawQuery("SELECT * FROM " + TABLE_NAME,null);
          return data;
  }
  
  //method to display data
  
      public Cursor displayData;
      {
          SQLiteDatabase db = this.getWritableDatabase();
          Cursor res = db.rawQuery(" SELECT  * FROM " + TABLE_NAME, null);
          return res;    
      }   
  
  }
  </code></pre>
  
  <p>I'm sure there is something really dumb I'm missing but any help would be appreciated.</p>