I created a bitmap on the screen of my Sony SmartEyeglass like this:
private void updateLayout(){
this.showBitmap(bitmap);
}
Now I want to update it every 40 milliseconds or so.
I tried calling it again and again from another thread and added this.clearDisplay()
but it doesn't work.
How can I achieve regular update of the display?
Update:
I used the suggested code below.
Result: Stuttering image that overlaps the previous which doesn't get cleared from the screen.
Tried adding canvas.drawRect(new Rect(0, 0, 500, 500), paint);
before redrawing.
Result: It still flickers, but now also won't show the new images.
Does anybody have any experience with real time graphics on SmartEyeglass. Reloading the Extension with different message to draw from is not an option!
By creating a postDelayed() handler you can run a method periodically.
your code should be like this.