android - Overflow icon not showing in ActionBar while using appcompat v7 library -


OK ... I have tried all stack overfollow solutions, none of them work.

Manifest

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Manifest xmlns: Android = "http://schemas.android.com/apk/res/android" package = "com.example.firstapp" Android: versionCode = "1" Android: versionName = "1.0" & gt; & Lt; Use-SDK Android: minSdkVersion = "8" Android: targetSdkVersion = "19" /> & Lt; Application Android: allowBackup = "true" android: icon = "@draubable / ic_luncher" android: label = "@ string / app_name" & gt; & Lt; Activity Android: name = "com.example.firstapp.DisplayMessageActivity" Android: label = "@ string / title_activity_desplay_smus" Android: parentActivityName = "com.example.firstapp.MainActivity" Android: Theme = "@ style / theme.AppCompat light "& gt; & Lt; Meta-Data Android: name = "android.support.PARENT_ACTIVITY" Android: value = "com.example.firstapp.MainActivity" /> & Lt; / Activity & gt; & Lt; Activity Android: name = "com.example.firstapp.MainActivity" android: label = "@ string / app_name" Android: Theme = "@ Style / Theme. AppCompat.Light" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; / Application & gt; & Lt; / Reveal & gt;   

inside /res/menu/main_activity_actions.xml

  & lt; Menu xmlns: android = "http: // schema .android.com / apk / ridge / android" xmlns: yourapp = "http://schemas.android.com/apk/res-auto" & gt; & Lt; Item android: id = "@ + id / action_search" Android: icon = "@ drawable / ic_action_screw" Android: title = "@ string / title_search" yourapp: showAsAction = "ifRoom" /> & Lt; item android: id = "@ + id / action_share" Android: icon = "@drawable / ic_action_share" android: title = "@ string / title_shair" yourapp: showAsAction = "ifRoom" /> & Lt; item android: id = "@ + id / action_settings" Android: icon = "@drawable / ic_action_settings" android: title = "@ string / title_settings" yourapp: showAsAction = "ifRoom" /> & Lt; / Menu & gt;  Main activity   
  Public boolean on crat option menu (menu menu) {getMenuInflater (). Flood (R.menu.main_activity_actions, menu); Return super.Connect option menu (menu); }   

Here is the screen shot.

Vertical Screen

Image Details Here Enter

Horizontal Screen

Enter image details here

*

The last icon in the ActionBar must be automatically added to the overflow as described in Google Docs. However, this is not happening, is it wrong here?

*

/ Code> The method of the activities in which you want to show the icon -

  try {viewConfiguration config = ViewConfiguration.get (this); Field menu field = field combination Class.getdcloidfield ("sHasPermanentMenuKey"); If (menuKieField! = Null) {menuKeyField.setAccessible (true); MenuKeyField.setBoolean (config, false); }} Hold (Exception Pre) {// ignore}    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -