tags:

views:

59

answers:

1

i am developing one chat form in my apps displying the chats i was taken linear laout but i need to refresh that chat msg every 5 seconds for that i am using timer.while dynamically adding it is showing getting values from db and add to layout but in gui i am not able to get those messages for that what i have to do. is there any way for chat application refreshing page .how to update the values to layout in android .pl it's very urgent to me

Thanks in advance

Aswan

+1  A: 

I'm not sure, that i understand right.

To update Layout information you can use findViewById(int). This is Method return View object. Then cast it to those real class. for examle:

TextView tv = (TextView) findViewById(R.id.TextView1);

To update this fields, use: tv.setText("Hello!");

There is no need, to "refresh page". You can use sockets and update fields when server replies (Using socket Events).

Demand
thankq for u r reply.sorry i am not good in english. but here i am not using the textview and all statically i am using dynamically because i need to display all the messages in layout and i need to refresh the page with latest messages
Aswan
Ok, i think there is no difference. You need to use LayoutInflater, or dynamically create new view. But you no need to refresh the whole page, only those part, that must be changed.
Demand