You can do this
Try this it would definetly help:
ActionBar action=getActionBar();
action.setDisplayShowCustomEnabled(true);
action.setDisplayShowHomeEnabled(false);
action.setDisplayShowTitleEnabled(false);
RelativeLayout relative=new RelativeLayout(getApplicationContext());
relative.addView(new SearchView(getApplicationContext()));
action.setCustomView(relative);
Do not forget to add layout params to your searchview so that it may align on right to relative.
Do let me know if any issue got.
Thank You
it would be then shown on right of action bar.
Also
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…