아래와 같이 블루통신소스에서 데이타를 받는 소스입니다
int i = 0;
int bytes = 0;
int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
String nValue = "";
// Keep listening to the InputStream while connected
try {
bytes = mmInputStream.read(buffer);
} catch (IOException e) {
Log.e(TAG, "disconnected", e);
// Toast.makeText(mContext, "에러", 1).show();
i=0;
}catch(Exception p) {
// Toast.makeText(mContext, "에러", 1).show();
i=0;
}
그런데 상대방에서 블루투스 통신을 끊으면 에러가 발생해서 어플이 먹통이됩니다
bytes = mmInputStream.read(buffer);
이쪽부분에서 에러가 나는거 같은데 try를 해도 똑같네요
도대체 어떻게 해야하나요?