Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MyApplication.me().getDatabase().productDao().getAllByCategoryCode(categoryCode)
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(categories -> {
- productsAdapter = new ProductsAdapter(categories);
- productsAdapter.setOnItemClickListener(item -> {
- BascetService.me().saveProducts(item);
- Toast.makeText(ProductsFragment.this.getActivity(), "Add", Toast.LENGTH_SHORT).show();
- });
- productsList.setAdapter(productsAdapter);
- });
Add Comment
Please, Sign In to add comment