Which two behaviors can be used to realize pop-up information?

First, the popup window pops up.

This method is very simple. It should be noted that if you want to click on other places to hide them, you should set the following four properties in the display:

//Make it the focus

mpopupwindow . setfocusable(true);

//Set to allow clicking outside to disappear.

mpopupwindow . setoutsidtouchable(true);

//refresh status

mpopupwindow . update();

//Click the Back key to make it disappear. Only when this option is set can OnDismisslistener be triggered and other controls be changed.

mpopupwindow . setbackgrounddrawable(new BitmapDrawable());

Second, Activity is a fake pop-up.

1? & ltstyle name="MyDialogStyle " >

2 & ltitem name = " Android:window background " & gt; @ Android:color/transparent & lt; /item & gt;

3 & ltitem name = " Android:window frame " & gt; @ null & lt/item & gt;

4 & ltitem name = " Android:window not title " & gt; true & lt/item & gt;

5 & ltitem name = " Android:windowIsFloating " & gt; true & lt/item & gt;

6 & ltitem name = " Android:windowIsTranslucent " & gt; true & lt/item & gt;

7 & ltitem name = " Android:windowContentOverlay " & gt; @ null & lt/item & gt;

8 & ltitem name = " Android:windowAnimationStyle " & gt; @android:style/Animation。 Dialog box < lt/item >;

9 & ltitem name = " Android:backgroundDimEnabled " & gt; true & lt/item & gt;

10 & lt; /style & gt;