這裡說一下這個layoutparams.type_phone。
我們看一下官方文檔說明:
these are non-application windows providing user interaction with the phone (in particular incoming calls). these windows are normally placed above all applications, but behind the status bar. in multiuser systems shows on all users' windows.
就是說設定了這個屬性之後,這個視窗會在是以的界面之上,但是在狀态欄的下面。在多使用者系統中,所有使用者的視窗上都會顯示。
<uses-permission android:name="android.permission.system_alert_window" />