Pass a Message From Thread to Update UI

前端 未结 2 534
粉色の甜心
粉色の甜心 2021-02-10 14:25

Ive created a new thread for a file browser. The thread reads the contents of a directory. What I want to do is update the UI thread to draw a graphical representation of the fi

2条回答
  •  走了就别回头了
    2021-02-10 15:04

    Check out AsyncTask for this kind of stuff. It's really much more elegant than rolling your own handler and passing messages back and forth.

    http://developer.android.com/reference/android/os/AsyncTask.html

提交回复
热议问题