0

I am currently learning Android Studio and I'm having a problem when I run the app on my Samsung Note 3.

Problem:- 1. The Action Bar looks faded on my phone. 2. Menu Button is not showing on my phone.

Screenshot on my Samsung Note 3 https://imageshack.com/i/exgIBDFBp

Screenshot on Android studio https://imageshack.com/i/p8qSUa9Sp

m1alesis
  • 670
  • 6
  • 16

2 Answers2

0

Are you defining a Toolbar in your XML? If so try removing the eleveation attribute.

Charles Durham
  • 2,445
  • 16
  • 17
  • Hi, I have not defined a Toolbar in my XML. Even if I create a brand new project and run it on my phone, I will have the same problem – m1alesis Apr 23 '15 at 20:26
  • I have the same phone as you, how do you not have this button? Is it like this for all apps? – Petro Apr 23 '15 at 20:33
  • what button? menu button? Yes all the projects in my Android Studio, the menu button is not showing for some reason when I run in my phone :( – m1alesis Apr 23 '15 at 20:58
0

My question had a similar issue. However, the Note 3 has a "physical" button for this at the bottom. This could override your apps.

I think your onCreateOptionsMenu - MenuInflater is the issue, change to the following and see if that works for you:

public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.activity, menu);
    return true;
}

For elevation issues:

For Android 5.0, if you want to set it directly into a style use:

<item name="android:elevation">0dp</item>

and for Support library compatibility use: 0dp

For pre 5.0 Android, add this too to your app theme:

<!-- Remove shadow below action bar Android < 5.0 -->
<item name="android:windowContentOverlay">@null</item>
Community
  • 1
  • 1
Petro
  • 3,484
  • 3
  • 32
  • 59
  • Hi Im using Holo Light DarkActionBar theme. When I add 0dp, I get compile error: Error:(6, 21) No resource found that matches the given name: attr 'elevation'. – m1alesis Apr 23 '15 at 20:38
  • Try the @null , under apptheme – Petro Apr 23 '15 at 20:46
  • Hi, tried that no errors but still did not solve the problem :( – m1alesis Apr 23 '15 at 20:53
  • You do know that the Note 3 has a physical button and the emulator doesn't right? So if you press that button what happens? – Petro Apr 23 '15 at 21:11