Android - using runOnUiThread to do UI changes from a thread

后端 未结 5 1227
走了就别回头了
走了就别回头了 2020-12-06 04:18

I am using a custom title view and would like to show/hide a progressbar in the title view when a thread is working.

This is my title view\'s XML

<         


        
5条回答
  •  猫巷女王i
    2020-12-06 04:53

    Few Things to try:

    1) (This probably isn't it) Make sure "titleProgress" is volatile.

    2) Try throwing a few postInvalidate() or titleProgress.postInvalidate() in there to trigger a redraw.

    3) Have you sacraficed a x486 machine on an alter resembling a giant green robot? (just kidding)

    Let me know if those first two (and if you're really desperate, the third) get you anywhere.

提交回复
热议问题