Моя проблема решена с помощью AsyncTask.
как
private class CustomTask extends AsyncTask<Void, Void, Void> {
protected Void doInBackground(Void... param) {
return null;
}
protected void onPostExecute(Void param) {
case 0x2b:
Log.d("AAA", "speed_data==>" + speed +"speed_id:--------"+ Data[0]);//here receiving properdata
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Log.d("AAA", "speed_data==>" + speed +"speed_id:"+ Data[0]);//here receiving junk data
}
});
break;
case 0x40:
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Log.d("AAA", "rpm_data==>" + rpm +"id:--------"+ Data[0]);//here receiving junk data
}
});
break;