0
1

More than 3 years have passed since last update.

Background表示をマスキングする

Last updated at Posted at 2021-08-03

こんなマスキングがしたい。
Screen Shot 2021-08-03 at 16.50.41.png

非表示にしたい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)
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1