ActionBar is deprecated, itβs better to use the Toolbar, and it also provides many functions, since the ActionBar API 21 has been replaced by a toolbar, due to which you get this error.
If you specify in your manifest file maxSDK, which is required less than API 21, you will not get this error.
But still use the ToolBar, it allows you to do what you can do with the view
source share