¡@

Home 

2014/10/16 ¤W¤È 08:22:10

android Programming Glossary: readtask

Android BluetoothSocket - Timing out

http://stackoverflow.com/questions/6346649/android-bluetoothsocket-timing-out

android multithreading bluetooth futuretask share improve this question Why not try something like public class ReadTask extends Thread private byte mResultBuffer private Exception mCaught private Thread mWatcher public ReadTask Thread watcher.. class ReadTask extends Thread private byte mResultBuffer private Exception mCaught private Thread mWatcher public ReadTask Thread watcher mWatcher watcher public void run try mResultBuffer sendAndReceive catch Exception e mCaught e mWatcher.interrupt.. return mCaught public byte getResults return mResultBuffer public byte wrappedSendAndReceive byte data new byte 1024 ReadTask worker new ReadTask data Thread.currentThread try worker.start Thread.sleep 6000 catch InterruptedException e either the..