Es ist dir also egal, dass deine App sich selbst abschießt ?
m_cdt = new CountDownTimer(30000,3000)
{
public void onTick(long millisUntilFinished)
{
Byte raus=1;
Byte rein=0;
try
{
dataoutputstream = new DataOutputStream(m_socket.getOutputStream());
dataoutputstream.writeUTF(""+raus);
}
catch (UnknownHostException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
try
{
datainputstream= new DataInputStream(m_socket.getInputStream());
rein=Byte.parseByte(datainputstream.readUTF());
}
catch (UnknownHostException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
if(rein!=1)
{
Toast.makeText(getApplicationContext(), "Keine Serververbindung", Toast.LENGTH_SHORT).show();
try
{
m_socket.close();
m_socket = new Socket("10.4.2.49",1025);
Toast.makeText(getApplicationContext(), "Serververbindung hergestellt", Toast.LENGTH_SHORT).show();
}
catch (Exception e)
{
Toast.makeText(getApplicationContext(), "Verbinden nicht möglich", Toast.LENGTH_SHORT).show();
}
}
else
{
Toast.makeText(getApplicationContext(),"Serverbindung hergestellt", Toast.LENGTH_SHORT).show();
}
}
public void onFinish()
{
this.start();
}
}.start();
}
in der 39. Zeile "m_socket = new Socket("10.4.2.49",1025);"
hat mit dem Button normal nichts zu tun
