0

I want to get rid of the app title bar so i add these codes:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

Instead i got an error with this:

03-05 16:30:48.735 10016-10016 E/AndroidRuntime: FATAL EXCEPTION: main

What is wrong with getting an app title bar removed?

2 Answers2

0

As the error message states, your theme needs to be Theme.AppCompat or decent of Theme.AppCompat.

That means you need a theme with its parent as Theme.AppCompat or theme with inherits it.

Add this to your styles.xml.

<style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

And in the manifest, change your activity theme to this theme.

<activity
    ...
    android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen">
Shreyash S Sarnayak
  • 2,309
  • 19
  • 23
  • i got 3 errors instead. Cant build apk because of this error: –  Mar 05 '17 at 09:14
  • Error:UNEXPECTED TOP-LEVEL ERROR: Error:java.lang.OutOfMemoryError: GC overhead limit exceeded :app:transformClassesWithDexForDebug FAILED Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_101\bin\java.exe'' finished with non-zero exit value 3 –  Mar 05 '17 at 09:14
  • Try doing `Invalidate cache and restart` in the file menu. – Shreyash S Sarnayak Mar 05 '17 at 09:18
-1

your activity extend AppCompatAcctity not Activity

F.King
  • 1
  • 1