Android, java - Unable to update variable from asynctask

后端 未结 4 1005
别那么骄傲
别那么骄傲 2021-02-11 04:39

Here is the code

Variable declared

 public String gpu2dcurent = \"1234567\";

Asynctask, after finished it should update variable gpu2dc

4条回答
  •  花落未央
    2021-02-11 05:18

    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???
    

提交回复
热议问题