fatal exception in android Timer

前端 未结 4 1570
旧时难觅i
旧时难觅i 2021-01-28 06:27

in my android application i\'m using Timer schedule.but getting Timer-0 fatal exception as below.how can i remove it.i have also mentioned code below -

01-28 13:         


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-28 07:05

    runOnUiThread(new Runnable() {
         public void run() {
    
           //stuff that updates ui
    
        }
    });
    

    try this

    also look at

    Android "Only the original thread that created a view hierarchy can touch its views."

    CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch views

    Only the original thread that created a view hierarchy can touch its views

提交回复
热议问题