How to make a window in activity?

I want to create a new window in action. like a popup. I saw the source code of the email application shipped with the Android OS and found this

import com.android.internal.policy.PolicyManager
Window w = PolicyManager.makeNewWindow(mContext);

But I can not find such a class in the SDK. Any idea?

+3
source share
3 answers

android.widget.PopupWindow may be what you need. http://developer.android.com/reference/android/widget/PopupWindow.html

Depending on what you are trying to do, you may use a dialog or activity that is not full-screen.

+1
source

You can use AlertDialog or just use Activity, but with the placement of a dialogue topic:

android:theme="@android:style/Theme.Dialog"

AndroidManifest.

0

Just a note. PopupWindow does not work with settings screens. AlertDialog is not allowed.

0
source

Source: https://habr.com/ru/post/1779842/


All Articles