Click here to Skip to main content
15,793,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working on the Client Server Project. I am facing a problem which is that the responses from the server are in string form bufferreader.readline() on clientSide.

If I am displaying this response on console then everything is fine but I have to display that Respond text data in the EditText Box. In that case my application is going to crash.
C#
public void run() {
 // TODO Auto-generated method stub
 try {
       System.out.println("Thread try state.");
       while ((message = reader.readLine()) != null)
       {
              //System.out.println("Read :" + message);

              // BufferedReader kb=new BufferedReader(new
              // InputStreamReader(System.in));
              // Log.e("Read:", message);

             chat_window_txtBox.append(message + "\n");  /// TRY STEP 1.....  Leaving POINT
             
                  tempString = message.toString();
                 System.out.println("Read :" + tempString);
              chat_window_txtBox.setText(tempString,BufferType.EDITABLE);/// TRY STEP2 ..... LEAVEING POINT
        
       }
     } catch (IOException e) {
           System.out.println("Cahched in Run::::");
           // TODO Auto-generated catch block
           e.printStackTrace();
     }
}
Posted
Updated 12-Oct-11 1:23am
v2
Comments
Slacker007 12-Oct-11 6:23am    
Edit - readability and code formatting.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900