Android Question Save last conf

Douglas Farias

Expert
Licensed User
Longtime User
hi i have a simple question

how to save the last config of my app

exemple :
TTS example, i run this select linguage pt-br ok, i use the app
and i close.

how to make when i run my app again it is pt-br ?

save the last linguage i selected?

how time i run app is the last linguage *-*

can someone post a simple exemple?
 

Douglas Farias

Expert
Licensed User
Longtime User
i dont understand i tested this on my galaxy and it dont save later i close, i back and no have my configs is normal defaut o_O
have other way to make this ?
for exemple make a .ini file?

you know this erel ? if u know show me a very very simple way to make this?
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
a sory i tested
StateManager

exemple

but i tested now back key and this exemple dont work
only with home key.

with home key work fine you back and is saved your configs but back key dont =(
have a way to make back key and home key save ?
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
you can disable the back key and place a save button on the settings screen where you save the settings.


or use something like this

B4X:
Sub Activity_KeyPress(KeyCode As Int) As Boolean

If KeyCode = KeyCodes.KEYCODE_BACK Then

StateManager.SaveSettings

End If

End Sub
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
it dont work when you back the app is not my configs


KEYCODE_BACK

finish the app and dont back the configs with this

B4X:
Sub Activity_KeyPress(KeyCode As Int) As Boolean

If KeyCode = KeyCodes.KEYCODE_BACK Then

StateManager.SaveSettings

End If

End Sub
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
how ? xD i dont know what is breakpoint :(
but this code dont save i tested only menu key *-*
 
Upvote 0
Top