I'm trying, without success, to wake the screen in a Data Field right before calling a DataFieldAlert.
It's working fine in the simulator, but when I test on my Venu 2s the app crashes. I've added a try and catch and recorded the error, I'm getting this message:
"Failed to turn on the backlight, 1 min limit exceeded."
It happens the first and only time that Attention.Baklight is called. Doesn't matter if the screen is on or off.
public function compute(data as Activity.Info) as Numeric or Duration or String or Null { if (!_alertDisplayed){ try { Attention.backlight(0.5f); // It crashes here } catch (e instanceof Lang.Exception) { System.println("!!! EXCEPTION CAUGHT: Backlight on failed !!!"); System.println(" Error Message: " + e.getErrorMessage()); System.println(" Error Code: " + e.getErrorMessage()); } Attention.vibrate(vibeData); WatchUi.DataField.showAlert(new $.DataFieldAlertView()); _alertDisplayed = true; } return "--" }
Not sure if it's a bug or if I'm missing something. It's the first time I try to use Attention.Baklight