Android MVVM: Where to put adapters?-ThrowExceptions

Exception or error: I’m building an Android app following the MVVM architecture. Where do adapters (for recyclerView, viewPager, etc) belong to? Do adapters belong to View or ViewModel? How to solve: Adapter belongs to View, but data source of Adapter belongs to ViewModel. ### If you’re following MVVM architecture than , adapters are belongs to …

mvvm – Android Architecture Components: using ViewModel for RecyclerView items-ThrowExceptions

Exception or error: I’m experimenting with the Architecture Components, and I want to build a ViewModel for each item of a RecyclerView. I’m not sure if that is formally correct or I should stick with the “old way”. I have this adapter: public class PostAdapter extends RecyclerView.Adapter<PostAdapter.PostViewHolder> { private List<Post> list; public static class PostViewHolder …