getSupportActionBar using FragmentActivity

喜夏-厌秋 提交于 2019-11-27 17:25:53

问题


I'm using fragment activity on one project, but it seems v4 support FragmentActivity doesn't has getSupportActionBar() method, and I need to use the support one in order to use android.support.v7.app.ActionBar


回答1:


The ActionBarActivity does support the method you require, and is a subclass of FragmentActivity. See: http://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html




回答2:


to use getSupportActionBar() you need extends ActionBarActivity like this http://antonioleiva.com/actionbarcompat-how-to-use/




回答3:


Sameera getSupportActionBar() is the new way to get the ToolBar. In fact, ActionBar is now deprecated in Google Material Design.




回答4:


Just use this.getActionBar() to get action bar



来源:https://stackoverflow.com/questions/19118720/getsupportactionbar-using-fragmentactivity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!