title: reading the date from sqlite in android
body: <p>I am storing some date in sqlite and when I try to retrieve data, it is returning null.</p>
  <pre><code>private ArrayList&lt;String&gt; file_list = new ArrayList&lt;&gt;();
  
       @Override
       protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
           ArrayList&lt;String&gt; _list = db.get_file
                (String.valueOf(myFiles.get(position).getId()), file_list);
           Log.e(&quot;TAG&quot;,&quot;_list &quot; + _list);
  
           case R.id.get_file:
              boolean save_file = db.add_file(String.valueOf(myFiles.get(position).getId()),
                                   file_list);
                      if (save_file){
                          Toast.makeText(this, &quot;saved successfully&quot;, Toast.LENGTH_SHORT).show();
                      } else {
                          Toast.makeText(this, &quot;saved failed&quot;, Toast.LENGTH_SHORT).show();
                      }
  
      public ArrayList&lt;String&gt; get_file(String id, ArrayList&lt;String&gt; arrayList){
  
      SQLiteDatabase db = this.getReadableDatabase();
      Cursor cursor = db.rawQuery(&quot;SELECT &quot; + COL_FILE + &quot; FROM &quot;
              +TABLE_NAME+&quot; WHERE &quot; + _ID +&quot; =? &quot; , new String[] {String.valueOf(id)});
  
      if(cursor.moveToFirst()){
          return arrayList;
      } else {
          return null;
      }
  }
  
   public TrackGroupArray read_tga_file(String id, TrackGroupArray tga)
      {
          SQLiteDatabase db = this.getReadableDatabase();
          Cursor cursor = db.rawQuery(&quot;SELECT &quot; + TGA_FILE + &quot; FROM &quot;
                  +TABLE_NAME+&quot; WHERE &quot; + _ID +&quot; =? &quot; , new String[] {String.valueOf(id)});
  
          if(cursor.moveToFirst()){
              return tga;
          } else {
              return null;
          }
      }
    
  
     TrackGroupArray read_tga = db.read_tga_file(String.valueOf(myFiles.get(position).getId()),
                      trackGroupArray);
  
       
  </code></pre>
  <p>Every time I save a file, it is saved successfully, I have checked in the db and the file is there. But when I want to retrieve it, <code>Log.e(&quot;TAG&quot;,&quot;_list &quot; + _list);</code> returns null.</p>