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.
Related
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 !
In an android application, I want to display a Dialog on screen and in the same time to allow user to click on the application's UI when the the Dialog is open
can this be done?
if no, what can I use instead of Dialog?
I don't think you can do this with Dialog. But you can do it with PopupWindow using PopupWindow.setOutsideTouchable(true);.
Showing up a dialog over your Activity, will make your Activity go into onPause() so you won't be able to actually handle things inside that activity anymore until the dialog is dismissed.
If you want to have some view, overlay your original activities view you'll be looking for into the direction of FrameViews, which can overlap other Views.
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.
Is there a way to dim the Current activity when calling the new activity? as in the new activity should be above the previous activity. The new activity that i have is a gallery. It comes when the finish button in the previous activity is clicked. So i want this gallery to be placed above the previous activity
Try setting the background of your gallery Activity to a transparent color. You might need to create a custom theme and more details can be found here: http://developer.android.com/guide/topics/ui/themes.html
This is probably going to be completely transparent, so not quite what you want. But, for example:
<activity android:theme="#android:style/Theme.Translucent">
I doubt if you could overlay two activities on top of each other. However, in order to achieve the effect that you mentioned, you could use a customized dialog to popup within your main gallery activity, and then set the rest of the screen as blurred, with the use of window manager. For an example of this, you can see: http://www.stealthcopter.com/blog/2010/01/android-blurring-and-dimming-background-windows-from-dialogs/