Forcing screen refresh programatically?

I’m developing an app that requires regular redraws of the screen. It’s essentially a clock. The screen sporadically stops refreshing. Sometimes 30+ seconds will go by before the screen redraws. Any ideas what I can do to force the refresh? Coincidentally, if I plug it in, it seems to always refresh like it should, so I feel like it’s related to a power saver setting.

Are you using the Onyx SDK to do the screen draws or just standard Android APIs?

I was using the Android APIs, but I just found out about the Onyx SDK and am trying to figure out how to do it properly.

So I’ve been messing with EpdDeviceManager, and I can’t seem to get the behavior I want. It looks like it updates for about 5 seconds and then stops.

Is there some way I can force it into whatever power mode it uses when plugged in? Because when it’s plugged in, it works perfectly.

Does this happen no matter which of the display modes is used?

I didn’t try every single, but I have tried:

EpdDeviceManager.enterAnimationUpdate(true);

EpdDeviceManager.setGcInterval(1);
EpdDeviceManager.applyGCUpdate(textView);

EpdController.setViewDefaultUpdateMode(view, UpdateMode.DU);
EpdController.setViewDefaultUpdateMode(view, UpdateMode.GU);
EpdController.setViewDefaultUpdateMode(view, UpdateMode.REGAL);
EpdController.setViewDefaultUpdateMode(view, UpdateMode.ANIMATION);

EpdController.invalidate(view, UpdateMode.DU);
EpdController.invalidate(view, UpdateMode.GU);
EpdController.invalidate(view, UpdateMode.REGAL);
EpdController.invalidate(view, UpdateMode.ANIMATION);

I update the clock a few times a second, so if I run this code from the constructor, it doesn’t make any difference. If I add the code (such as the invalidate) to the handler, then it “works”, but the screen flashes constantly.

Like I said, without any of this code, it works as desired when plugged in, even if it’s just a usb battery.

Hi @sureshot007 would you like to join the Discord? I would be interested in this too