0

How to create the activity full screen in android programmatically using kotlin.

Thanks!

3
  • kotlinlang.org/docs/reference/android-overview.html Commented Jul 31, 2017 at 5:39
  • 1
    You may want to take help from this thread stackoverflow.com/questions/2868047/… if you want to convert it into kotlin then you can use converter or read what @IntelliJAmiya suggested Commented Jul 31, 2017 at 5:43
  • 1
    Wondering why this question is marked as duplicate and having so many down votes. The question redirected is not showing any code in kotlin lang... Commented Jan 22, 2019 at 13:55

1 Answer 1

12

Import Window packages

import android.view.Window
import android.view.WindowManager

Add your onCreate method

   override fun onCreate(savedInstanceState: Bundle?) {
    requestWindowFeature(Window.FEATURE_NO_TITLE)
    super.onCreate(savedInstanceState)     
    window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN)
   setContentView(R.layout.activity_test_test)
   }
Sign up to request clarification or add additional context in comments.

3 Comments

by using this code my app is crash Log: Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
add code before set content
check edited answer

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.