1

In Android Studio, the app shows like I expect it to. Although when the app is debugged, the banner that displays the name of the app disappears.

Where did I make an error?

To be more clear, here's how it shows on Android Studio:

enter image description here

Here's how it shows when I run the app (as you can see there's no banner)

enter image description here

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.it5.foothillers.MainActivity"
    android:background="#f4f4f4">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:weightSum="1"
        android:paddingEnd="0dp"
        android:paddingStart="0dp"
        android:layout_margin="0dp">

        <Button
            android:layout_width="fill_parent"
            android:layout_height="23dp"
            android:text="NEWS"
            android:id="@+id/button"
            android:layout_weight="0.28"
            android:background="@android:color/holo_blue_bright"
            android:textColor="#ffffff"
            android:textSize="48dp" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="SPORTS"
            android:id="@+id/button2"
            android:layout_weight="0.20"
            android:background="@android:color/holo_blue_light"
            android:textColor="#ffffff"
            android:textSize="48dp" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="24dp"
            android:text="EVENTS"
            android:id="@+id/button3"
            android:layout_weight="0.29"
            android:background="@android:color/holo_blue_dark"
            android:textColor="#ffffff"
            android:textSize="48dp" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="24dp"
            android:text="MORE"
            android:id="@+id/button4"
            android:layout_weight="0.24"
            android:background="#f1f108"
            android:textSize="48dp" />
    </LinearLayout>
</RelativeLayout>
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245

2 Answers2

1

Update:

if your app extends Activity please change if to AppCompatActivity.

Mounir Elfassi
  • 2,242
  • 3
  • 23
  • 38
1

Make sure your class extends AppCompatActivity and if still you don't see the action bar, try changing the theme of your app in the AndroidManifest.xml to Theme.AppCompat.Light.DarkActionBar.

You can also try setting this in your styles.xml in res

<item name="android:windowActionBar">false</item>

I hope it helps! Kind regards!

Isaac Urbina
  • 1,295
  • 11
  • 21