Two NavHosts with their own NavControllers and NavGraphs (Navigation Component) //Android Kotlin Dev Diary

I am trying to make a single-activity app because I’d like to easily share data across screen using, ideally one, or as few as possible ViewModels. NavGraph 1 Host: Layout file of MainActivity Destination(s): CreateLogFragment NavGraph 2 Host: Layout file of CreateLogFragment Destination(s): CreateLogFoodFragment, CreateLogNotesFragment (CreateLogFragment has a BottomNavigationBar that switches between CreateLogFoodFragment and CreateLogNotesFragment) […]

Read More

Dao Error: Not sure how to handle query method’s return type //Android Kotlin Dev Diary

As I brush up on my Room database knowlege I came upon the following error while building my app:

The solution: Set Kotlin version to 1.6.10 then Room to 2.4.2 (Or use more recent compatible versions) in my top-level build.gradle file. Reference: Android Room Kotlin throws Delete Query error

Read More

Sample Instrumented Test for Retained Text After Screen Rotation // Android Kotlin Dev Diary

First I added the following UI Automator to my app: So now my build.gradle (Module) file has the following dependecies: Then under the package app/src/androidTest/java/net/catzie/samplecalculatorapp I added the following instrumented test class: What it does is press the buttons 1, period, and 5 on the calculator’s UI to show “1.5” which should show up the […]

Read More