title: Error inserting Data into SQLite database?
body: <p>I keep getting this error </p>
  
  <blockquote>
    <p>07-10 21:50:06.296: ERROR/Database(538): android.database.sqlite.SQLiteException: no such table: task: , while compiling: INSERT INTO task(descrip, time, title, date, status) VALUES(?, ?, ?, ?, ?);</p>
  </blockquote>
  
  <p>When I execute this line of code. Am I inserting it the wrong way?</p>
  
  <pre><code>private View.OnClickListener onSave = new View.OnClickListener() {
  
      @Override
      public void onClick(View v) {
      String type = null;
  
      switch(status.getCheckedRadioButtonId()){
      case R.id.completed:
          type = "completed";
          break;
      case R.id.in_progress:
          type="in-progress";
          break;
      }
      if(taskId == null){
          helper.insert(title.getText().toString(), descrip.getText().toString(), date.getText().toString(), time.getText().toString(), status.toString());
              Toast.makeText(getBaseContext(), "Task Saved", Toast.LENGTH_SHORT);
      }
      else{
          helper.update(taskId, title.getText().toString(), descrip.getText().toString(), date.getText().toString(), time.getText().toString(), type);
  
      }
  
      finish();
  
      }
  };
  </code></pre>
  
  <p>Here is my SQL database insert method:</p>
  
  <pre><code>class TaskHelper extends SQLiteOpenHelper {
  private static final String DATABASE_NAME = "taskask.db";
  private static final int SCHEMA_VERSION = 1;
  
  public TaskHelper(Context context){
      super(context, DATABASE_NAME, null, SCHEMA_VERSION);
  }
  
  @Override
  public void onCreate(SQLiteDatabase db) {
      db.execSQL("CREATE TABLE reminders (_id   INTEGER   PRIMARY   KEY    AUTOINCREMENT, title TEXT, descrip TEXT, date TEXT, time TEXT, type TEXT)");
  
  
  }
  
  
  @Override
  public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
      // TODO Auto-generated method stub
  
  }
  
  public Cursor getAll(){
      return(getReadableDatabase().rawQuery("SELECT _id, title, descrip, date, time, type FROM reminders ORDER BY title", null));
  
  }
  public void insert(String title, String descrip, String date, String time, String status){
      ContentValues cv = new ContentValues();
      cv.put("title", title);
      cv.put("descrip", descrip);
      cv.put("date", date);
      cv.put("time", time);
      cv.put("status", status);
      getWritableDatabase().insert("task", "name", cv);
  }
  public Cursor getById(String id){
      String [] args = {id};
  
      return(getReadableDatabase()    
              .rawQuery("SELECT _id, title, descrip, date, time, status FROM task WHERE _ID=?",args));
  
  
  }
  public void update(String id, String title, String descrip, String date, String time, String type){
      ContentValues cv = new ContentValues();
      String [] args={id};
      cv.put("title", title);
      cv.put("descrip", descrip);
      cv.put("date", date);
      cv.put("time", time);
      cv.put("status", type);
      getWritableDatabase().update("task", cv, "_ID=?", args);
  
  
  }
  public String getTitle(Cursor c){
      return(c.getString(2));
  }
  public String getDescrip(Cursor c){
      return(c.getString(3));
  }
  public String getDate(Cursor c){
      return(c.getString(4));
  
  }
  public String getTime(Cursor c){
      return(c.getString(5));
  }
  public String getStatus(Cursor c){
      return(c.getString(6));
  }
  </code></pre>
  
  <p>}</p>