When I try to use getActionBar() it says it is deprecated, so that means by going forward we are not allowed to use getActionBar().
getActionBar()
Which
If you are using appcompat, the correct method is getSupportActionBar()
appcompat
getSupportActionBar()