title: Android/Kotlin: How to create a class that uses a DBLocal class? Error message: Type mismatch require context
body: <p>I would like to create a general DB class that manage a local DB and another DB. I have a mistake, but I don't understand what is the problem...</p>
  
  <p><strong>General class:</strong>  </p>
  
  <pre><code>class DBHandler {
      companion object {
          val sharedInstance = DBHandler() //gérer si sharedinstance est null pour éviter pb d'ecriture
      }
  
      fun methodToSelectData(strQuery: String, dataBase: String)/*, completion: @escaping (_ result:*/
      {
          print(message = strQuery)
  
          val dbLocal = DBLocal(this, null, null, 1) //pb on this line
          dbLocal.methodToSelectData(strQuery)
      }
  }
  </code></pre>
  
  <p><strong>DB Class:</strong>  </p>
  
  <pre><code>class DBLocal(context: Context, name: String?, factory: SQLiteDatabase.CursorFactory?, version: Int) : SQLiteOpenHelper(context, DATABASE_NAME, factory, DATABASE_VERSION)
  {
  
      override fun onCreate(db: SQLiteDatabase)
      {
          print(DATABASE_NAME)
      }
  
      override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int)
      {
  
      }
      fun methodToSelectData(strQuery: String)/*, completion: @escaping (_ result:*/
      {
  
      }
  
      fun methodToInsertUpdateDeleteData(strQuery: String)/*, completion: @escaping (_ result: Bool) -&gt; Void)*/
      {
  
      }
      companion object {
          private val DATABASE_VERSION = 1
          private val DATABASE_NAME = "Local.db"
      }
  }
  </code></pre>
  
  <p>Thanks in advance.</p>