1 package android.permissionui.cts.helper.overlay
2 
3 import android.app.Activity
4 import android.os.Bundle
5 import android.view.ViewGroup
6 import android.view.ViewGroup.LayoutParams.MATCH_PARENT
7 import android.view.WindowManager
8 import android.widget.LinearLayout
9 import android.widget.TextView
10 
11 class OverlayActivity : Activity() {
12 
onCreatenull13     override fun onCreate(savedInstanceState: Bundle?) {
14         super.onCreate(savedInstanceState)
15         val mainLayout = LinearLayout(this)
16         mainLayout.layoutParams = ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
17         val textView = TextView(this)
18 
19         textView.text = "Find me!"
20         mainLayout.addView(textView)
21 
22         val windowParams = WindowManager.LayoutParams()
23         windowParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
24         windowManager.addView(mainLayout, windowParams)
25     }
26 }
27