Hi,
I have a Listview filled with Items in the Array mStrings[]
and a Textview Area filled with Items in Array mTexte[]
Usualy I easily can change the content of the listview by mStrings[1]="test"
and the same with the mTexte Items.
But now I read some data from the net in a thread (got the code in the net)
and there is also a updater where I also can change text in my GUI.
There for example I can change Text mTexte[1]="test" and it chance
my Textview.. cool. But it does not work with my Listview.
Before I start the Handler it works for both, mTexte and mStrings.
but while the Handler is active I only can change mTexte??
Whats wrong? How can I chance my mStrings in the showUpdate
or after the Thread is finished?
Here my code
mStrings[1]="111111111111"; mTexte[1]="111111";
mHandler = new Handler();
checkUpdate.start();
mStrings[1]="33333333333";
mTexte[1]="333333";
}
//------------------------------------------------------------------
private Thread checkUpdate = new Thread() {
public void run() {
try {
String mediaUrl = "http://www.xxxx.com/3gp/tibet.txt";
URLConnection conn = new URL(mediaUrl).openConnection();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
byte buf[] = new byte[8192];
while((current = bis.read(buf)) != -1){
infomessage= ""+current; mHandler.post(showUpdate);
}
infomessage="Finished"; mHandler.post(showUpdate);
} catch (Exception e) {
}
}
};
private Runnable showUpdate = new Runnable(){
public void run(){
mTexte[1]="222222222";
mStrings[1]="22222222222";
}
};
thanks
chris

