Android Actionbar compatibility alternate xml for pre-honeycomb -


i using actiobarcompat sample in application , trying implement search pre 3.0 devices.

<menu xmlns:android="http://schemas.android.com/apk/res/android" >  <item     android:id="@+id/menu_search"     android:orderincategory="1"     android:title="@string/menu_search"     android:icon="@drawable/ic_home"     android:showasaction="collapseactionview|ifroom"     android:actionviewclass="android.widget.searchview" />  </menu> 

on honeycomb+ works fine, searchview widget appears in actionbar. trying have second menu xml can fall old search activity way of doing it. however, there no such thing menu-v11 folder menu folder menu-v11 because version started supporting this.

my question is, using actionbar compatibility sample, there way declaratively add alternate button pre-honeycomb?

can please more specific trying achieve?

it it's calling different activities depending on api version, action bar has nothing that. analyse api version in onoptionsitemselected , act accordingly.

if want different menu items depending on api version, create folder menu-v11 (or menu-v14) , put version-specific xml-s- there.

btw, use com.android.actionbarcompat , works great me!


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -