title: Android room database - Not sure how to convert a Cursor to this method's return type
body: <p>I'm trying to save this object in Room database, I read about Typeconverters for converting complex objects in one filed that can be stored in database. I am getting this error:
      <strong><em>error: Not sure how to convert a Cursor to this method's return type  (androidx.lifecycle.LiveData>).----
  public abstract androidx.lifecycle.LiveData> queryQuestions(@org.jetbrains.annotations.NotNull()</em></strong>
  My code is based on solutions that I found for similar problems with converting objects for room but this isn't working for me.</p>
  
  <p>My question class:</p>
  
  <pre><code>@Entity
  
      data class Question(@PrimaryKey var questionId: String = "",
                          val uid: String,
                          val name: String,
                          val photo: String,
                          val question: String,
                          val points: Int,
                          @ServerTimestamp val timestamp: Date? = null,
                          val options: ArrayList&lt;Option&gt;){
          constructor(): this("", "", "", "", "", 0, null, ArrayList())
      }
  
      data class Option(val optionText: String,
                        val correct: Boolean,
                        var votes: Int = 0,
                        var usersVoted: ArrayList&lt;UserVoted&gt; = ArrayList()){
          constructor(): this("", false /*,0, ArrayList()*/)
      }
  
      data class UserVoted(val name: String,
                           val photo: String){
          constructor(): this("", "")
      }
  </code></pre>
  
  <p>My dao class:</p>
  
  <pre><code>@Dao
  interface QuestionDao {
      @Insert(onConflict = REPLACE)
      fun insertQuestions(question: ArrayList&lt;Question&gt;)
  
      @Query("SELECT * FROM question WHERE uid = :userId")
      fun queryQuestions(userId: String): LiveData&lt;ArrayList&lt;Question&gt;&gt;
  }
  </code></pre>
  
  <p>My database class:</p>
  
  <pre><code>@Database(entities = [Question::class], version = 1)
  @TypeConverters(Converter::class)
  abstract class AppDatabase : RoomDatabase(){
      abstract fun questionDao(): QuestionDao
  
  }
  </code></pre>
  
  <p>My converter class:</p>
  
  <pre><code>class Converter {
  
      @TypeConverter
      fun fromTimestampToDate(value: Long?): Date? {
          return value?.let { Date(it) }
      }
  
      @TypeConverter
      fun fromDateToTimestamp(date: Date?): Long? {
          return date?.time?.toLong()
      }
  
      @TypeConverter
      fun fromStringToArrayList(value: String): ArrayList&lt;Option&gt; {
          Log.i("alengenije", "fromStringToArrayList string = $value")
          val listType = object:TypeToken&lt;ArrayList&lt;Option&gt;&gt;() {}.type
          return Gson().fromJson(value, listType)
      }
  
      @TypeConverter
      fun fromArrayLisrToString(list: ArrayList&lt;Option&gt;): String {
          val gson = Gson()
          return gson.toJson(list)
      }
  
  }
  </code></pre>