Search code examples
android-studioandroid-layoutandroid-checkbox

After upgrading to Android Studio 4.1 why doesn't the text in my CheckBox controls display in runtime (but does display in design mode)?


Here's a snapshot of my app where you can see the running app which has missing text and you can see the text that should be displaying (which is properly displaying in design mode).

Why isn't the text displaying at runtime?

textview doesn't display text

This only started happening when I updated to version 4.1 of Android Studio and rebuilt my app.

Additionally, here is how they are defined in the layout xml:

layout xml


Solution

  • Here's a view of the layout details of the one checkbox that is not displaying the text:

    detail shows points (pt)

    Notice that it is showing text size in PT (points).

    I changed it to sp after choosing from droplist and now it displays properly.

    Not sure why this has always worked in the past and suddenly stopped working.

    If it is a change I would expect an auto-update functionality when Android Studio upgrades the project.

    Should Not Work In Design Mode Either

    If it is a problem I would also expect it to display improperly in the Design Mode also. Instead it looks correct in design mode even though runtime doesn't display it. In this way I would've understood that I was using an incorrect unit.

    TextView Also

    I found that this was also happening in many of my TextView controls. resolved issue