textview - Android character sizes -


I have a client socket that sends a few lines (ANSI encoding) which creates a shape. The problem is that in the log cat, when I print the lines, they make a full size, but in my layout, the textviews are not even shaping even when they have the same length. I can see that the problem is the space character With the byte size But since I can see it on the log cat, there should be a way to set the text view to create a full size. I & # 39; Tried to change with and set texts as an html form, but there is no luck at all. Is there any way I am missing?

class clients apply the Runnable {Private BufferedReader input; @ Override Public Wide Run () {// TODO auto-generated method stub {InetAddress servAddress = InetAddress.getByName (SERVER_IP); Socked = new socket (server, server); Input = new BufferedReader (new InputStreamReader (socked.getInputStream (), "windows-1252")); While (! Thread.currentThread (.) Integrated ()) {String read = input.readLine (); UpdateConversationHandler.post (new updateUITHead (read)); }} Hold (unknownhostexception e) {// Todo auto-generated catch block e.printStackTrace (); } Grip (IOException E) {// TODO Auto-Generated Catch Block e.printStackTrace (); }}} Class updateUIThread tool runanle {String msg; Public update UITHead (string stroke) {this.msg = str; } @ Override Public Wide Run () {// Tudo Auto-Generated Method Stub Text Viv TV = New TextView (cont); Tv.setTextColor (Color.WHITE); // tv.setText (makeTextWithColors (msg)); // tv.setText (msg + "count:" + msg.length ()); Tv.setText (MSG); Screen.addView (TV); Scroller.post (New Runnabel) {Public runs zero () {scroller.smoothScrollTo (0, screen.getBottom ());}}); }}

looks like

  tv SetTypeface (Typeface.MONOSPACE);  

A trick is a font that makes all the characters with the same width.


Comments