Tiny DB not storing or retrieving data


blue_tooth.aia (6.6 KB)

My app needs to persist txtinterval.text
It does not appear to do that.
If I change the number in txtinterval.text, it does not appear when the screen is closed and re-opened. There is only 1 screen in this app.

Any thoughts?

Your textbox is not losing focus, therefore your new value is not being saved. You need another textbox sized 1 x 1 pixels, that you can set the focus to when you click a button.

thanks for the reply.
Doesn't it lose focus when a button is pushed?

Buttons do not take the focus (even though there are blocks for it), you have to use another textbox

From @ewpatton:

The original use of the GotFocus/LostFocus events were when Android phones had trackballs to navigate the UI. Focus would move when you moved the trackball highlight over a component (e.g., button). In the days of touch screens and no trackballs, the events still exist but are likely only triggered in limited circumstances.

@Ken made a quick extension to give components the focus

image

RequestFocus.aia (6.8 KB)

com.appybuilder.kennicholsandroid.RequestFocus.aix (4.7 KB)

1 Like

good info. thanks

Hi

A much simpler solution would be to update TinyDb when the text Interval is updated. That could be assured by replacing the TextBox with a Spinner......also avoids User run-time syntax errors which currently would crash the App.