activity.ReceiveDataParsingEvent(new MainActivity.ReceiveDataParsingEventListener() {
@Override
public void onReceiveDataParsingEvent(float[] parsingData) {
//parsingData로 Data를 받아옵니다.
}
});
여기서 이제 UI스레드를 통해 ui를 업데이트 하려고 하는데
받아오면 스레드에 알려줘서 업데이트를 하고 할 수 있나요??
final Handler handler = new Handler();
new Thread() {
public void run() {
while(true) {
handler.post(new Runnable() {
@Override
public void run() {
//UI Update
}
});
SystemClock.sleep(500);
}
}
}.start();
지금 위의 상황 처럼 구현하려고 하니 500마다 데이터가 들어오든 말던 업데이트를 하는 것 같아서 문제가 있어 보입니다. ㅠ