Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid implement missing hardware OptionsMenu button
    text
    copied!<p>I'm new in the world of android. Until now each and every "OptionsMenu" could be created like this:</p> <pre><code>@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_list_view_controller, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection switch (item.getItemId()) { case R.id.menu_settings: startActivity(new Intent (ListViewControllerActivity.this, PreverencesActivity.class)); return true; case R.id.menu_devsettings: startActivity(new Intent (ListViewControllerActivity.this, DevPreferencesActivity.class)); return true; default: return super.onOptionsItemSelected(item); } } </code></pre> <p>But now , for example, the new htc one have no hardware OptionsMenu button. When the OptionsMenu is implemented like my source, the menubutton inside the display won't show up. How can implement the OptionsMenu right, that no additional button in the layout is needed? Or can this button inside the display somehow be activated?</p> <p><strong>EDIT:</strong> I think I gave a little less information to solve the problem, because the android won't take care of it in API 16 Jelly Bean. So again. I've implemented the option menu like above. But now with the "htc one" which has no hardware option menu button, the in-screen option menu button doesn't show up.</p> <p>Here is my layout xml, which i'm using (it could be a layout problem):</p> <pre><code>&lt;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" &gt; &lt;ImageView android:id="@+id/img_logo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:layout_alignParentTop="true" /&gt; &lt;TextView android:id="@+id/txt_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:background="#1e4870" android:textColor="#ffffff" android:layout_below="@+id/img_logo"/&gt; &lt;ListView android:id="@android:id/list" android:layout_below="@+id/txt_title" android:layout_above="@+id/img_bottom_bar" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;/ListView&gt; &lt;ImageView android:id="@+id/img_bottom_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/footer" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:background="@android:drawable/bottom_bar" android:src="@android:drawable/bottom_bar" /&gt; &lt;RelativeLayout android:id="@+id/footer" android:layout_width="wrap_content" android:layout_height="50dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/footer_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_toLeftOf="@+id/footer_img_bs" android:textAppearance="?android:attr/textAppearanceSmall" /&gt; &lt;ImageView android:id="@+id/footer_img_bs" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:src="@drawable/ic_launcher" /&gt; &lt;/RelativeLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>And here the part of the manifest, which i thought would solve this problem:</p> <pre><code>&lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /&gt; </code></pre> <p>I've also googled this problem many times. But it seems that i'm the only person around here with that problem. So i have to be a little stupid or something. </p> <p>Before I forget: Thank you WebnetMobile.com for trying to help me. It could be that i'm just (like i've said before) too stupid to understand your answer.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload