Вот ошибка:
Код: Выделить всё
Error:(22, 42) error: Not sure how to convert a Cursor to this method's return type
UserDao.java
Код: Выделить всё
@Dao
public interface UserDao {
@Query("SELECT * FROM user")
LiveData getAll();
//Compile Error is here : Not sure how to convert a Cursor to this method's return type
@Query("SELECT * FROM user")
LivePagedListProvider userByPagination();
}
Код: Выделить всё
public class UserModel extends AndroidViewModel {
private final UserDao userDao;
public UserModel(Application application) {
super(application);
userDao = RoomDB.getDefaultInstance().userDao();
}
public LiveData getAllUser() {
return userDao.getAll();
}
public LiveData
> getAllUserPagination() {
return userDao.userByPagination().create(
/* initial load position */ 0,
new PagedList.Config.Builder()
.setEnablePlaceholders(true)
.setPageSize(10)
.setPrefetchDistance(5)
.build());
}
}
Образец 1
Документ Google
Я поднял этот вопрос ЗДЕСЬ
Буду признателен за любую помощь
Подробнее здесь: https://stackoverflow.com/questions/466 ... ods-return