Search code examples
androidfirebase-mlkit

Android TextView.setText works after screen rotate


Today I'm testing google ml-kit example.

I have rewritten LivePreviewActivity to show barcode value in TextView. Barcode reading is good. But TextView text changes only after rotating the screen or when we unlock the device.

Can you help me?

Activity example


Solution

  • Thanks to everyone who puzzled over my question.
    The reason for the inability to update the textview is a very hard request to get the barcode value.
    Solution: it was necessary to wrap a heavy request in the Handler.