Answer the question
In order to leave comments, you need to log in
[Android] Handling "while pressed" button?
Actually the problem is this, in the application there is data transfer over the network on a timer.
Something like this happens:
Socket s = new Socket(ip, port);<br/>
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));<br/>
ScheduledExecutorService timer1 = Executors.newSingleThreadScheduledExecutor();<br/>
timer1.scheduleAtFixedRate(new Runnable() {<br/>
public void run() {<br/>
out.write("default message");<br/>
out.flush();<br/>
}<br/>
}, 10, Long.parseLong("100"), TimeUnit.MILLISECONDS);<br/>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question