1

Android menu is not showing text, but when I click on the menu it does execute the intended action. I believe maybe something wrong with the text color? But I did not change the color anywhere in the code.

enter image description here

Being run is a fragment Activity with the following XML

<LinearLayout
    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"
    android:background="@color/white"
    android:orientation="vertical"
    android:layout_weight="2"
    >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="45dip"
        android:background="@color/main_app_color"
        android:gravity="center"
        android:text="@string/header_app_name"
        android:textAlignment="center"
        android:textColor="@color/white"
        android:textSize="22sp"
        android:textStyle="bold"
        >
    </TextView>

    <FrameLayout android:id="@+id/main_fragment_container"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:layout_marginBottom="5dip"
        >
    </FrameLayout>

    <ImageView android:id="@+id/some_image"
        android:layout_width="fill_parent"
        android:layout_height="75dip"
        android:scaleType="fitCenter"
        android:src="@drawable/adsyh"
        />

</LinearLayout>

Update

Apptheme:

<style name="AppBaseTheme" parent="android:Theme.Holo.NoActionBar.Fullscreen">
</style>

<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:windowNoTitle">true</item>
</style>
Blottt
  • 119
  • 1
  • 13
  • updated i with the apptheme being used – Blottt Mar 21 '14 at 21:36
  • Could you change menu item color to black? In this section show how to change menu item text color. (http://stackoverflow.com/questions/3519277/how-to-change-the-text-color-of-menu-item-in-android) – nurisezgin Mar 21 '14 at 21:40
  • Is white defined by `#FFFFFF` in your color.xml file? – Rookatu Mar 21 '14 at 21:47
  • And what is the `main_app_color` defined to be? Also, did you try nurisezgin's suggestion and if so were you able to see the text? – Rookatu Mar 21 '14 at 21:55
  • main app color is just blue ... I tried and get a null pointer on : MenuItem x = menu.getItem(0); – Blottt Mar 21 '14 at 22:17
  • if I debug and look at the menu items i see : method threw 'java.lang.NullPointerException' exeception. Cannot evaluate com.android.internal.view.menu.MenItemImpl.toString() – Blottt Mar 21 '14 at 22:28

1 Answers1

1

I have no idea why this worked, but I just replaced the contents of the menu/main.xml with the following and it started to show the text again in black color.

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/action_settings"
        android:title="@string/action_settings"
        android:orderInCategory="100"
        android:showAsAction="never" />
</menu>
Blottt
  • 119
  • 1
  • 13