https://developer.android.com/reference/android/widget/PopupWindow
I am trying to keep my popupWindow when changing activities, and not recreating it each time I change activity.
Is this possible?
In the docs it says that -
This class represents a popup window that can be used to display an arbitrary view. The popup window is a floating container that appears on top of the current activity.
It states current activity, but is there a property I can set that will only change the activity behind the popup ?
Thank you !
Related
I am opening a dialog fragment on Button click in a activity. Now I don't want loose focus on my background activity after opening the dialog fragment. The background activity has a chat window so the edit text in that chat window should not loose focus, to be more precise one should be able to chat even when the dialog fragment is open. Is there any way to make this happen?
One can place an individual layout( which is your dialog layout ) onto the center of the screen
(gravity="center" or centerinParent="true")
and set its visibility to invisible or gone.Then when you make the dialog layout appear, the edittext will be focusable as well.
I would encourage other answers which may be an alternative to this behavior which the OP wants.
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 have a popup which I implement with an activity, e.i the activity doesn't fill the whole screen, and looks like a popup.
How can I disable the caller activity? (The background activity).
I want the same functionality as if I used a classic popup:
popup.setOutsideTouchable(false);
Thanks in advance!
you can create an activity with
android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen".
There add your view over the transparent activity like a popup.
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.
I want to make Semi Transaparent Activity Like pop window i.e. As my appActivity starts one pop up window on top that should come and user should click proceed button to go on that activity. I have seen dialog as well as Alert Box but they are widget. I want to use the screen as activity so that I can put xml layout .
I have come across PopWindow but I do not know how to use it .I have made one class PopupWindow When I try to achieve findviewbyid I am unable to achieve it becoz PopupWindow class is not extending anything ....
So what should i use if popWindow class then how to use it ? thanks
create an layout as you like to have as a dialogue and create an activity using that layout.
in the manifest declare that activity and add android:theme="#android:style/Theme.Dialog in that activity stub.