Search code examples
androidandroid-fragmentsfragmentmanager

Display login window on top of the main fragment


I want to add a login window on top of my main fragment and close it after user logs in. The login window should be smaller than the screen size so main fragment should be visible in the background. It should be impossible to close the window in any other way than logging in. I am thinking about adding a relative layout where login table should be displayed on top of the main fragment, and be hidden after user logs in. However, this does not look like an elegant solution to me. Is there a better way to achieve this?


Solution

  • Alert dialog will work, but best practices say you should just have a login fragment they cant get past. making it look like its an overlay is possible too, with a screenshot of you app as the background