Android Question Choicr of Admin or user dialog before main screen is shown

mscientist33

Active Member
Licensed User
Is it possible to have a dialog to show before the app starts that let's the user choose between an admin or user and if admin is chosen then enter a password? If the password is CORRECT then start and load an admin layout, if incorrect or user is chosen then load a user layout. Is this possible?
 

Brian Dean

Well-Known Member
Licensed User
Longtime User
Is it possible to have a dialog to show before the app starts ...
Is that what you really mean? It is not possible to control or influence what happens before your app starts. Instead you start your app by displaying a dialogue and depending on the user's response go down one of two different paths.
 
Upvote 0

mscientist33

Active Member
Licensed User
I can check screen size before it loads and then load the correct layout based on that. So it's not possible to show a dialog and then load an admin or user layout?
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
I do not know why you would want to check the screen size - I still feel that I do not quite understand what you want to do.

You can certainly show a dialogue (loaded as a Layout) and then remove it and load a different layout. Here is a demo. I am afraid that I don't use B4XPages, but something similar can be done in B4XPages I am sure.
 

Attachments

  • TwoPaths.zip
    12.6 KB · Views: 56
Upvote 0

mscientist33

Active Member
Licensed User
I check the screen size because I have two layouts. One for a 7 in tablet and one for a 10 in tablet. When the app loads it checks the screen size and loads the correct layout for that screen size. Each layout has quite a few common buttons and such with the same name. That way any code changes works for both layouts.
 
Upvote 0
Top