PRoblem with THREADS !!?

Put your problem here if it does not fit any of the other categories.

PRoblem with THREADS !!?

Postby kbkbkb » Tue Jan 22, 2008 2:24 pm

i am doing a project of 1 on 1 chat between google phone(client) and a java-application(server)

now i am encountering a problem

i should have 2 threads right ?

one for client another for server message-processing ?

but whenever i do this, the emulator showed the massage

".....only the original thread that created a view hierarchy can touch its views "

WHY ?? plz anyone tell me~

kbkbkb
regards.
kbkbkb
Freshman
Freshman
 
Posts: 6
Joined: Tue Jan 22, 2008 2:17 pm

Top

Postby Ishtar » Tue Jan 22, 2008 6:31 pm

You have 1 server thread and 1 client thread? Or do you mean you got 1 thread for the connection and 1 for the GUI? I never got this error, but it seems like you made another thread what is trying to access your views. Like changing the text on a text view. The way around is to send data back to the thread containing the views, and let this thread change them. More code=more help :D
Ishtar
Experienced Developer
Experienced Developer
 
Posts: 50
Joined: Wed Jan 16, 2008 10:22 pm
Location: Netherlands

Postby kbkbkb » Wed Jan 23, 2008 8:53 am

Ishtar wrote:You have 1 server thread and 1 client thread? Or do you mean you got 1 thread for the connection and 1 for the GUI? I never got this error, but it seems like you made another thread what is trying to access your views. Like changing the text on a text view. The way around is to send data back to the thread containing the views, and let this thread change them. More code=more help :D


THANK you!!

i found the answer here!!

http://www.anddev.org/problem_with_prog ... -t515.html

it needs handler to handle it

kbkbkb
regards
kbkbkb
Freshman
Freshman
 
Posts: 6
Joined: Tue Jan 22, 2008 2:17 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 11 guests