How to create a count-up effect for a textView in Android

后端 未结 6 1507
隐瞒了意图╮
隐瞒了意图╮ 2020-12-13 07:17

I am working on an app that counts the number of questions marks in a few paragraphs of text.

After the scanning is done (which takes no time at all) I would love to

6条回答
  •  春和景丽
    2020-12-13 07:56

    Use a worker thread to do the waiting and update your UI thread.

    You could use an AsyncTask, though it might be an overkill for this job. If you use this, In the doInBackground() loop over the number of sleep periods and after every sleep period, update the count in the UIthread.

    There you go! Slukain just gave you the working code :P

提交回复
热议问题