• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Toast doen't pop up

KorenRon

Lurker
hello ,
I have an application that send data to my server user TCP connection and wait for reaply.
the data is been send using tcp - working
I get the replay I want from the server .
when I run the code in debug mdoe - I can see ther replay here "ServerRaplay"

but when I don't see it on the Toast - nothing pop up in the my tablet/phone

there are no errors when I run the code


String messageStr = intentData + "!" + Name+"!"+ Phone+";

String ServerRaplay;
Socket clientSocket = new Socket(server_ip, server_port);
DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
outToServer.writeBytes(messageStr + 'n');
ServerRaplay = inFromServer.readLine();
Toast.makeText(getApplicationContext(),ServerRaplay,Toast.LENGTH_LONG).show();

clientSocket.close();

what am I missing?
this is all I have done in order to run the toast , didn't add nothing nowhere.(in mainActivity )
Thanks,
 
When debug, does it goes to this line ?

Code:
Toast.makeText(getApplicationContext(),ServerRaplay,Toast.LENGTH_LONG).show();
 
Back
Top Bottom