Programatically enable and navigate to full screen apps in android

231 Views Asked by At
  1. In the Android Phone-Samsung there is an option in settings called Full-screen apps
  2. On click of it we have options Auto and Full screen

Questions

  1. Is there a way we can programmatically check this from the app
  2. How to navigate the user for this page for particular app selections from an app with the click of a button

enter image description here

1

There are 1 best solutions below

5
Top4o On

Answer for question 1:

I think you can use this flag WindowManager.LayoutParams.FLAG_FULLSCREEN like this:

val fullScreenApp = (window.attributes.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN)!= 0

Answer for question 2:

Note - both package names here are for example find the ones you need first and replace.

val intent = Intent()
intent.component = ComponentName(
    "com.samsung.android.Settings", // application package
    "com.samsung.android.Settings.Widget.FullScreenAppActivity" // Activity package
)


try {
    startActivity(intent)
} catch (e: Exception) {
    // Custom error handling
}

N.B: - be aware that both package names can change over time so keep them up to date or make a dynamic package name search.