Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Activity Title vs ActionBar Title

What is the difference between Activity Title and Action Bar Title. Both seem to occupy same area

however activity title is set using

getActivity().setTitle("abc") 

and Action Bar Title by

getActivity().getActionBar().setTitle("abc") 
like image 912
Raja Nagendra Kumar Avatar asked Dec 20 '25 14:12

Raja Nagendra Kumar


1 Answers

Well, there is a difference,
When setting the action bar's title using the setTitle method of class ActionBar will only be displayed if DISPLAY_SHOW_TITLE is set or action bar is present in the activity.

However, the setTitle method of Activity class can be used to set title even when there isn't any action bar for that window.

This really makes a difference when you are using a screen readers such as Talkback or developing an app for users with disabilities. It simply makes your app more accessible.

like image 190
global_warming Avatar answered Dec 22 '25 06:12

global_warming



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!