android - Difference between setSupportActionBar and setActionBar -


so trying use toolbar actionbar in app. trying use setsupportactionbar() method in fragment hosted activity extends class extends appcompatactivity. reason i'm not able getactivity().setsupportactionbar() @ all, can getactivity().setactionbar(). problem setsupportactionbar() accepts android.support.v7.widget.toolbar setactionbar() accepts android.widget.toolbar. causes app restricted devices using lollipop.

a side issue i've found when trying change theme of toolbar dark

app:theme="@style/themeoverlay.appcompat.dark" 

it doesn't work.

getactivity() has class activity, if activity kind of subclass appcompatactivity. have cast getactivity(), call

((appcompatactivity)getactivity()).setsupportactionbar() 

for theme-problem should post details have put style-definition or rather put in separate question.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -