title: how to store images and text to sqlite database from async and show as gridview
body: <p>how to </p>
  
  <blockquote>
    <p>store images and text</p>
  </blockquote>
  
  <p>to sqlite database from async and show as gridview,
  I'm using these two methods for </p>
  
  <pre><code> public void insertData(String name)
  {
      SQLiteDatabase sqLiteDatabase=this.getWritableDatabase();
      ContentValues values=new ContentValues();
      values.put("name",name);
      sqLiteDatabase.insert("pos",null,values);
      Log.v("insertion success",name);
  }
  public ArrayList fetchData()
  {
      ArrayList&lt;String&gt;stringArrayList=new ArrayList&lt;String&gt;();
      String fetch_data="select * from pos";
      SQLiteDatabase sqLiteDatabase=this.getReadableDatabase();
      Cursor cursor=sqLiteDatabase.rawQuery(fetch_data, null);
      if(cursor.moveToFirst()){
          do
          {
              stringArrayList.add(cursor.getString(0));
          } while (cursor.moveToNext());
      }
      return stringArrayList;
  }
  </code></pre>
  
  <ol>
  <li>how to insert image and retrieve</li>
  </ol>
  
  <p>This is my insertion</p>
  
  <pre><code> JSONObject jsonOBject = jsonData.getJSONObject(i);
                      service = jsonOBject.getString("service");
                      id=jsonOBject.getString("id");
                      icons = jsonOBject.getString("icon");
  
                      model = new ItemObject();
                      model.setContent(service);
                      model.setImageResource(icons);
  
                      arrayList.add(model);
                      database.insertData(service);
  </code></pre>
  
  <p>and set like this,</p>
  
  <pre><code> database_arrayList=database.fetchData();
          ArrayAdapter adapter=new ArrayAdapter(getActivity(),android.R.layout.activity_list_item,android.R.id.text1,database_arrayList);
          gridView.setAdapter(adapter);
  </code></pre>
  
  <blockquote>
    <p>Please help me</p>
  </blockquote>