October 22, 2024
Chicago 12, Melborne City, USA
Android

How to set custom dialog full screen? (android)


I want to show custom dialog in full screen.
But It’s not now.
I don’t know why.

This is my code

val dialog = Dialog(requireContext())
val view = LayoutInflater.from(activity).inflate(R.layout.custom, null)

dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialog.setContentView(view)
dialog.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
dialog.window?.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN)
dialog.window?.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
dialog.window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video