Guest User

Untitled

a guest
Nov 24th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. MyApplication.me().getDatabase().productDao().getAllByCategoryCode(categoryCode)
  2. .subscribeOn(Schedulers.io())
  3. .observeOn(AndroidSchedulers.mainThread())
  4. .subscribe(categories -> {
  5. productsAdapter = new ProductsAdapter(categories);
  6. productsAdapter.setOnItemClickListener(item -> {
  7. BascetService.me().saveProducts(item);
  8. Toast.makeText(ProductsFragment.this.getActivity(), "Add", Toast.LENGTH_SHORT).show();
  9. });
  10. productsList.setAdapter(productsAdapter);
  11. });
Add Comment
Please, Sign In to add comment