Android, java - Unable to update variable from asynctask

后端 未结 4 744
无人及你
无人及你 2021-02-11 04:51

Here is the code

Variable declared

 public String gpu2dcurent = \"1234567\";

Asynctask, after finished it should update variable gpu2dc

4条回答
  •  余生分开走
    2021-02-11 05:32

    In gpu class declare it as followin:

    public String gpu2dcurent = "1234567";
    

    In AsyncTask class readgpu2d, use it as following:

    gpu.gpu2dcurent = result;
    

    Update your UI=User Interface means TextView in

    onProgressUpdate()

    method of AsyncTask.

    And check where have you declared gpu2dcurent variable???
    

提交回复
热议问题