title: cannot resolve method "xxx"
body: <p>I have 2 spinner and 1 button. If the button is clicked, it will save the two selected item from spinner to SQLite. But I get cannot resolve method "insertTimeSheet" message.</p>
  
  <p>I need help. Thanks.</p>
  
  <p><strong>MyDatabaseHelper.java</strong></p>
  
  <pre><code>package com.example.project.project.database;
  
  import android.content.Context;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteOpenHelper;
  import android.util.Log;
  
  
  public class MyDatabaseHelper extends SQLiteOpenHelper {
      public static final int DATABASE_VERSION=1;
      public static final String DATABASE_NAME="Company.db";
      public final static String TABLE_NAME="TimeSheet";
      public static final String ID="id";
      public static final String Name="name";
      public static final String Weather="weather";
      public static final String DATABASE_CREATE_TIME_SHEET="create table"+TABLE_NAME+"(ID INTEGER PRIMARY KEY AUTOINCREMENT,"+ Name+"TEXT,"+ Weather+"TEXT)";
      public void onCreate(SQLiteDatabase db)
      {
          db.execSQL(DATABASE_CREATE_TIME_SHEET);
      }
  
      public void onUpgrade(SQLiteDatabase db, int oldVersion,int newVersion)
      {
          Log.w(MyDatabaseHelper.class.getName(),"Upgrading database from version"+oldVersion+"to"+newVersion+",which will destroy all old data");
          db.execSQL("Drop TABLE IF EXISTS "+DATABASE_NAME);
          onCreate(db);
      }
  
      public MyDatabaseHelper(Context context)
      {
          super(context, DATABASE_NAME,null,1);
      }
  }
  </code></pre>
  
  <p><strong>TimeSheetAPI.java</strong></p>
  
  <pre><code>package com.example.project.project.API;
  import android.database.sqlite.SQLiteDatabase;
  import com.example.project.project.database.MyDatabaseHelper;
  import android.content.Context;
  import android.database.SQLException;
  import android.content.ContentValues;
  
  public class TimeSheetAPI {
      private SQLiteDatabase database;
      private MyDatabaseHelper dbHelper;
      public String[] allColumns={MyDatabaseHelper.ID,MyDatabaseHelper.Name,MyDatabaseHelper.Weather};
  
      public TimeSheetAPI(Context context)
      {
          dbHelper=new MyDatabaseHelper(context);
      }
  
      public void open() throws SQLException {
          database = dbHelper.getWritableDatabase();
      }
  
      public void close() {
          dbHelper.close();
      }
  public long insertTimeSheet(String name,String weather)
  {
      ContentValues values=new ContentValues();
     // values.put(MyDatabaseHelper.ID,id);
      values.put(MyDatabaseHelper.Name,name);
      values.put(MyDatabaseHelper.Weather,weather);
      return database.insert(MyDatabaseHelper.TABLE_NAME,null,values);
  }
  
  }
  </code></pre>
  
  <p><strong>TimeSheet.java</strong></p>
  
  <pre><code> public void add()
      {
          btnSaved.setOnClickListener
                  (
              new View.OnClickListener() {
                  public void onClick(View v) {
                      long isInserted= dbHelper.insertTimeSheet(spinner2.getSelectedItem().toString(), // cannot resolve...inserttimeSheet
  spinner.getSelectedItem().toString());
  
  
  
                  }
              }
                  );
          }
  </code></pre>