18

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

Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206

4 Answers4

28

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

Thijs Mergaert
  • 399
  • 3
  • 4
1

Just use this.getActionBar() to get action bar

Chetan Pawar
  • 404
  • 3
  • 4
0

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

everson
  • 37
  • 1
  • 2
0

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

camelCaseCoder
  • 1,447
  • 19
  • 32
lgallard
  • 462
  • 3
  • 10