Preferences not being called on resume

Cableguy

Expert
Licensed User
Longtime User
I have this sub:
B4X:
Sub Activity_Resume
   If Main.PrefManager.GetString("Server") = "" Then
      CToast.ShowBitmap("Introduza o servidor do Jogo !",750,Gravity.CENTER, 0, 0, LoadBitmap(File.DirAssets,"Warning.png"))
      StartActivity(main.PrefScreen.CreateIntent)
   Else If Main.PrefManager.GetString("UserName") ="" Then
      CToast.ShowBitmap("Introduza o seu Username !",750,Gravity.CENTER, 0, 0, LoadBitmap(File.DirAssets,"Warning.png"))
      StartActivity(main.PrefScreen.CreateIntent)
   Else If Main.PrefManager.GetString("PassWord") = "" Then
      CToast.ShowBitmap("Introduza a sua PassWord !",1500,Gravity.CENTER, 0, 0, LoadBitmap(File.DirAssets,"Warning.png"))
      StartActivity(main.PrefScreen.CreateIntent)
   End If
End Sub

When the user does press the back button, exiting from the preferences screen, the activity is resumed, so the CToast (Custom Toast) does show, but the prefsScreen is not called again...
The idea is to prevent the user from returning to the Activity withou filling the preferences...
Whats Wrong?
 

Cableguy

Expert
Licensed User
Longtime User
Thanks Erel...

I mooved the code to the Activity_KeyPress sub, and somehow the behaviour suites me...
When the back key is pressed once, the prefs show-up, and if back is pressed again, the app exits..wich is good...
My intention is that the user be reminded that there are missing settings that will make the app un-usable, and it does the job.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…