Search in sources :

Example 1 with CategoryDB

use of com.yydcdut.note.model.dao.CategoryDB in project PhotoNoter by yydcdut.

the class CategoryDBTest method testUpdateCategory.

public void testUpdateCategory() {
    CategoryDB categoryDB = new CategoryDB(this.getInstrumentation().getTargetContext());
    List<Category> categoryList = categoryDB.findAll();
    Category category = categoryList.get(0);
    category.setLabel("789456");
    mRxCategory.updateCategory(category).subscribe(new Subscriber<List<Category>>() {

        @Override
        public void onCompleted() {
            YLog.i("yuyidong", "onCompleted");
        }

        @Override
        public void onError(Throwable e) {
            YLog.i("yuyidong", "onError,,,e--->" + e.getMessage());
        }

        @Override
        public void onNext(List<Category> categories) {
            YLog.i("yuyidong", "categories.size()--->" + categories.size());
            for (Category category : categories) {
                YLog.i("yuyidong", category.toString());
            }
        }
    });
}
Also used : RxCategory(com.yydcdut.note.model.rx.RxCategory) Category(com.yydcdut.note.entity.Category) CategoryDB(com.yydcdut.note.model.dao.CategoryDB) List(java.util.List)

Aggregations

Category (com.yydcdut.note.entity.Category)1 CategoryDB (com.yydcdut.note.model.dao.CategoryDB)1 RxCategory (com.yydcdut.note.model.rx.RxCategory)1 List (java.util.List)1