The requestWindowFeature method must be placed before the content view is initialized. I checked that this is the first one, but later I found that I changed the class inheritance. Before I inherited the Activity, I changed the class inheritance to AppCompatActivity.
At first I wondered if it was possible that AppCompatActivity had done something in its own super.onCreate. So the
At first I wondered if it was possible that AppCompatActivity had done something in its own super.onCreate. So the
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
On the
super.onCreate(savedInstanceState);
Finally, in the manifests file, we add an attribute to the Activity:
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
solves the problem.
The title bar is not an ordinary title bar. It is called ActionBar. Another solution is to call it after setContentView
getSupportActionBar().hide();
solves the problem.
Read More:
- [Android] using request window feature( Window.FEATURE_ NO_ Title) method to remove the title invalid solution
- Request window feature for Android Development( Window.FEATURE_ NO_ Title) does not take effect
- Android set request window feature( Window.FEATURE_ NO_ Title) invalid solution
- An error is reported for the new Android project. Rejecting re init on previously failed
- Access characteristics of construction methods in Java inheritance
- Activity of Android studio_ main.xml Unable to preview (gray page)
- Failed to load AppCompat ActionBar with unknown error
- XML tag has empty body less… (Ctrl+F1) Reports empty tag body. The validation works in XML / JSP
- Android has applied for permission and still prompts open failed: eacces (permission denied)
- Execution failed for task ‘:app:processDebugManifest’
- Get the startup activity of Android apk
- Solution to error opening trace file: no such file or directory (2) in Android
- An example of drawing rotating cube with OpenGL
- Aidl learning
- Android Studio error “Manifest merger failed with multiple errors, see logs” solution
- Error inflating class in WebView in Android 5. X android.webkit.WebView Solutions
- Unknown error (SQLite code 14): could not open database (How to Fix)
- Error running app: Default Activity Not Found
- How to share a process among multiple apks
- Android avoids memory leak: reasonable use of getcontext() and getapplication ()