在我的OnCreate方法中,我创建了一个线程来监听传入的消息!
In OnCreate() {
//Some code
myThread = new Thread() {
@Override
public void run() {
receiveMyMessages();
}
};
myThread.start();
// Some code related to sending out by pressing button etc.
}
Then, receiveMyMessage() functions…
Public void receiveMyMessage()
{
//Receive the message and put it in String str;
str = receivedAllTheMessage();
// << here I want to be able to update this str to a textView. But, How?
}
我查看了这篇文章,但对我无效,没有任何帮助!
handler = getWindow().getDecorView().getHandler();
- Kent