title: DatabaseHandler() in DatabaseHandler can not be applied to
body: <p>I wanted to create sqlitedatabase and wanted to save my data in.</p>
  
  <p>SavetoDataAdapter.class</p>
  
  <pre><code>import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.BaseAdapter;
  
  import com.andisofttechnology.myapplication.DatabaseHandler;
  import com.andisofttechnology.myapplication.R;
  
  import java.util.List;
  
  /**
   * Created by Alfraganus on 9/20/2018.
   */
  
  public class SavedDataAdapter extends BaseAdapter {
  LayoutInflater layoutInflater;
  List&lt;Student&gt;studentList;
  Context context;
  DatabaseHandler databaseHandler;
  
  public SavedDataAdapter(Context context,List&lt;Student&gt;list){
      this.studentList = list;
      this.context = context;
      layoutInflater = (LayoutInflater)this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      databaseHandler = new DatabaseHandler(this.context);
  }
  
      @Override
      public int getCount() {
          return studentList.size();
      }
  
      @Override
      public Object getItem(int position) {
          return studentList.get(position);
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
         if(convertView == null){
             convertView = layoutInflater.inflate(R.layout.activity_attendance, null);
         }
  
  
      return convertView;
      }
  </code></pre>
  
  <p>DatabaseHandler.class</p>
  
  <pre><code>import android.database.sqlite.SQLiteOpenHelper;
  
  import com.andisofttechnology.myapplication.adapter.Student;
  
  import java.util.ArrayList;
  import java.util.List;
  
  
  public class  DatabaseHandler extends SQLiteOpenHelper{
  
      public static final int DATABASE_VERSION = 1;
      public static final String DATABASE_NAME = "attendace";
      public static final String TABLE_STUDENT = "student";
      public static final  String STUDENT_ID = "_id";
      public static final  String STUDENT_NAME = "name";
      public static final  String STUDENT_SURNAME = "surname";
      public static final  String STUDENT_CONTACT = "contact";
      public static final String  STUDENT_ROLLNUM = "rollNum";
  
  
      private final Context mContext;
      SQLiteDatabase database;
  
  
      public DatabaseHandler(Context context, String name, SQLiteDatabase.CursorFactory factory, int version, Context mContext) {
          super(context, DATABASE_NAME, null, DATABASE_VERSION);
          this.mContext = mContext;
      }
  
      @Override
      public void onCreate(SQLiteDatabase database) {
  database.execSQL("CREATE TABLE " + TABLE_STUDENT + "(" + STUDENT_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + STUDENT_NAME + " TEXT, " + STUDENT_SURNAME + " TEXT, " + STUDENT_CONTACT + " TEXT, " + STUDENT_ROLLNUM + " TEXT" + ")");
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
          database.execSQL("DROP TABLE IF EXISTS " + TABLE_STUDENT);
          onCreate(database);
  
      }
  
      public long StudentKiritish(Student studentList)
      {
          SQLiteDatabase database = this.getWritableDatabase();
          ContentValues cv = new ContentValues();
  
          cv.put(STUDENT_NAME,studentList.getName());
          cv.put(STUDENT_SURNAME,studentList.getSurname());
          cv.put(STUDENT_CONTACT,studentList.getContact());
          cv.put(STUDENT_ROLLNUM,studentList.getRollNum());
  
          Long insert = database.insert(TABLE_STUDENT, null, cv);
          database.close();
          return insert;
  
      }
  public List&lt;Student&gt;studentLists() {
          List&lt;Student&gt; list = new ArrayList&lt;&gt;();
          SQLiteDatabase database = this.getReadableDatabase();
          String s = "select * from " + TABLE_STUDENT;
      Cursor cursor = database.rawQuery(s,null);
  
      if(cursor.moveToFirst()){
          do {
              list.add(new Student(cursor.getInt(cursor.getColumnIndex(STUDENT_ID)),
                      cursor.getString(cursor.getColumnIndex(STUDENT_NAME)),
                      cursor.getString(cursor.getColumnIndex(STUDENT_SURNAME)),
                      cursor.getString(cursor.getColumnIndex(STUDENT_ROLLNUM)),
                      cursor.getString(cursor.getColumnIndex(STUDENT_CONTACT))));
  
                             }while (cursor.moveToNext());
  
      }database.close();
      return list;
  }
  }
  </code></pre>
  
  <p>In SaveDataAdapter.class there is red line under: databaseHandler = new databaseHandler(this.context)
   Says context can not be applied to</p>
  
  <p>Please anybody tell me what the issue is
  ...................................................................................</p>