The hosting blank activity is shown behind the dialog, but I want it to be shown on top of the home screen. Is there a way to "hide" the activity since nothing is shown inside of it anyway? The activity is needed because I am planning on showing another dialog after the user clicks a selection from the first one.
Figured it out! For anyone wondering, the answer is to make the activity transparent. Here's another stack overflow question that describes how: How do I create a transparent Activity on Android?
Related
When a RelativeLayout in an activity is clicked, it should open a fragment that shows a few checkboxes. The fragment should be in the center of the screen but should not cover the whole screen. The original contents activity should appear in the background but it should be grayed out. When I click 'OK' button in the fragment, the fragment should disappear and the original contents of the activity should appear normal (without graying out). I've tried writing a lot of code but what I get is completely different from what I have in mind. How can I achieve this functionality?
you should use DialogFragment , see this thread: https://developer.android.com/reference/android/app/DialogFragment.html
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?
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
I have to show a floating button that will be added in WindowManager so it remain on the top of all Activities. (I have done this part using https://github.com/marshallino16/FloatingView)
When that button is tapped I have to open screen and show detail view and navigate between other views. To achieve this thing I can do following things either adding
1 - PopUpWindow
2 - Dialog
But I cannot provide navigation using either of them. So my questions is.
What is the best way to add multiple views and providing navigation between them while keeping everything above the application that is running it.
How can we add Activity so that it won't pause user application?
You should open Activity and implement all navigation inside it.
Android may pause activities behind, so make your Activity only for part of the screen.
Inside Activity hide floating button and show it again on exit.
I want a view which is partially visible on the main activity and if we click on it, it slides up and shows up completely. Something like "click to show details".
One workaround I have thought of is that when the main activity is in front, a button which looks like the partial custom view appears. On clicking that button, the custom view slides up.
I found an unanswered question which asks for the same solution as I.
Yes I found a library called StandOut https://github.com/pingpongboss/StandOut
this might be useful for what you want.
I am using a dialog themed activity in android to show a popup from a application context. The dialog has a transparent theme, but the issue is that I want the underlying activity to have focus and not the popup though the popup must be visble. How do I achieve this in android?
I think you would have to use a Fragment and just make it look like a popup dialog.
You can not switch focus between activities. There's only one activity "on focus" at the time, and is the one that is being displayed at that point. The transparent background doesn't mean you can access the activity below.
If i don't get it wrong, you want to be able to interact with the activity's controls while having a "Dialog" on the screen. Any sort of Dialog class from Android will not help, since they take the focus away. Not really sure about PopupWindow, but i'm guessing will be the same thing as the documentation says "that appears on top of the current activity."
You are going to have to create a custom dialog using a RelativeLayout/FrameLayout within your activity.