Category "android-architecture-components"

Can I change topLevelDestinationIds from AppBarConfiguration?

I have CountriesFragment and this fragment is launching first (start destination) I hid the back button using this code NavigationUI.setupWithNavController(mate

Manually clearing an Android ViewModel?

Edit: This question is a bit out of date now that Google has given us the ability to scope ViewModel to navigation graphs. The better approach (rather than tryi

ViewModel updates on screen rotation

I've created a simple project to study Kotlin and Android architecture https://github.com/AOreshin/shtatus The screen consists of RecyclerView and three EditT

How to clear navigation Stack after navigating to another fragment in Android

I am using The new Navigation Architecture Component in android and I am stuck in clearing the navigation stack after moving to a new fragment. Example: I am

Is there any way to remove item from PagedList and notify RecyclerView?

Is there any way to remove item from PagedList and notify RecyclerView without invalidating DataSource (not Room)? What I have tried: Store all model in own l

State of nested Fragments is lost when returned to same tab in 'Navigation Architecture Component'

I'm exploring the the 'Navigation Architecture Component' concept which introduced in Google I/O 2018 last month. Let say I have an activity with a bottom nav

Cannot create an instance of class ViewModel

I am trying to write a sample app using Android architecture components and but even after trying for days I could not get it to work. It gives me the above exc

Cause: androidx.navigation.safeargs can only be used with an androidx project

I am facing issue with navigation component called safeargs. I have used classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.0.0' in build grad

Room Dao LiveData as return type causing compile time error

I am using Room and implemented Dao that returns LiveData. It was working fine with below dependency added. implementation "androidx.room:room-runtime:2.1.0-al

Room Persistence: Error:Entities and Pojos must have a usable public constructor

I'm converting a project to Kotlin and I'm trying to make my model (which is also my entity) a data class I intend to use Moshi to convert the JSON responses fr