非表示にしたいActivity内で下記を追加する。
activity.window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
全画面で対応したい場合はApplication.ActivityLifecycleCallbacks
を実装したActivity内でこうする。
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
super.onActivityCreated(activity, savedInstanceState)
activity.window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)