sockets - How can I split the server message on Android -
i know few command on java, first time encounter problem. example message of server "111||222||333". how can client split message on 3 textbox? output must textbox1=111, textbox2=222 , textbox3=333.
you can use basic java method purpose:
string[] separated = "111||222||333".split("||"); separated[0]; // contain 111 separated[1]; // contain 222 separated[2]; // contain 111
then set text in "textbox" (called textview in android):
textview tv111 = (textview) getactivity().findviewbyid(r.id.textview_111); textview tv222 = (textview) getactivity().findviewbyid(r.id.textview_222); textview tv333 = (textview) getactivity().findviewbyid(r.id.textview_333); tv111.settext(separated[0]); tv222.settext(separated[1]); tv333.settext(separated[2]);
Comments
Post a Comment