androidandroid-studioandroid-roomdatabase-inspector

Android Studio Database Inspector always showing database as "closed"


I am trying to use Database Inspector in Android Studio. Why I run the app on the device, it inspector is always showing my application database (highlighted in the image) as "closed".

Is there any fix for this or did I miss something during the setup?

enter image description here


Solution

  • UPD. last time I had this annoying issue Invalidate cache/Restart fixed this for me. Sigh

    Running the app in Debug mode enter image description here (Win: Shift+F9 or Mac: Control+D) does the magic for me sometimes.

    Not sure if this is a bug or not. The android documentation doesn't mention on this, so I guess it should just work in normal mode, but for some reason doesn't for me..

    I use (Android Studio 4.2 beta 3). Property minSdkVersion set to 27.

    I don't use Room or any other ORM, just a few plain simplest queries.

    The toggle 'Keep database connection open' doesn't seem helping either.

    In normal mode:

    enter image description here

    In Debug mode (what I want):

    enter image description here

    Noticeable, that it continuing to work (querying the database etc) even after I stopped the app running in Debug mode:

    enter image description here