Showing Custom Layout on Overflow Drop Down Menu Item? Android -


How do I want to show a custom view for item (inside the overflow menu), but I know this It can not seem that it still only shows the title: S. I want to do something like Twitter to show icon, title and subtitle in first item in the drop-down menu. Anybody can help me

items in menu.xml

  & lt; Android: id = "@ + id / action_dropdown" Android: icon = "@drawable / ic_action_overflow" Android: actionProviderClass = "efwefwef.com.actionbar.ABDropDown" Android: Title = "Android": showAsAction = "always" & gt; ; & Lt; / Item & gt;  

Action Provider Category # 1

  Public category Abderopdown ActionProvider Extended {Personal Static Last String TAG = "MANDPProvider"; Personal reference references; Public ABD ProDown (Reference Reference) {Super (Reference); This.context = context; } @ Override Public View Processactionview () {Return Null; } @ Override Public Boolean in SBMMenu () {Log D. (Tag, "hishammenu"); Back true; } @ Override Public Boolean Percentage Default Action () {Log D. (Tag, "OnformForm Default Action"); Return super.onPerformDefaultAction (); } @PerareSubMenu on the above public zeros (submenu submenu) {subMenu.clear (); SubMenu.add ("profile") setActionProvider (new ABDprodoprophe (reference)); SubMenu.add (Menu.NONE, Menu.NONE, 2, "Table 2"); }}  

The second action python class for the item I want to show a custom view

  Public category AbderopadanProfile ActionProvider Extended {Personal Stable Last String TAG = " "; Personal reference references; Public ABD Prodoprophile (Reference Reference) {Super (Reference); This.context = context; } @ Override Public View on Creating View () {View View = View. Flight (references, rl.actionbar_viewprofile, empty); Return view; } @ Override public boolean sbmmenu () {return false; } @ Override Public Boolean Percentage Default Action () {Log D. (Tag, "OnformForm Default Action"); Return super.onPerformDefaultAction (); }}  

I had just encountered the same problem of how custom overflow Rows can be listed in the menu. Unfortunately there is nothing more about the web about customizing action bars. If you just want to list items with the title on the menu and icon, then you need to nest the objects within the items. I did this to:

   & Lt; Item android: id = "@ + id / weather" android: icon = "@ drawable / ic_action_cloud" Android: orderInCategory = "98" Android: showAsAction = "always" android: title = "@ string / weather_title" / & gt; & Lt; Item android: id = "@ + id / search" Android: actionViewClass = "android.widget.SearchView" android: icon = "@ drawable / ic_action_search" Android: orderInCategory = "97" Android: showAsAction = "collapseActionView | always" Android : Title = "@ string / search_title" /> & Lt; / Menu & gt;  

To get this thing:

Comments