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.