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.
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.
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
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.