MainActivity.this.in = MainActivity.this.uart.getInputStream();
int re = in.read();
All of above is my part of code. I want to read a digit from peripheral device. if the waiting time is over 3 seconds. Stop! Then appear a warning information! But I don't know how to interrupt the wait.