ActionBar setDisplayShowTitleEnabled - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ActionBar setDisplayShowTitleEnabled method.

This code example shows how to use the following methods:setBackgroundDrawable, setCustomView, setDisplayShowCustomEnabled, setDisplayShowTitleEnabled
     * @param title The title for the action bar 
     * @param subtitle The subtitle for the action bar. 
     */ 
    public void themeActionBar(final ActionBar actionBar, final String title) {
        // Set the custom layout 
        actionBar.setCustomView(mActionBarLayout);
        actionBar.setDisplayShowCustomEnabled(true);
        actionBar.setDisplayShowTitleEnabled(false);
 
        // Theme the action bar background 
        actionBar.setBackgroundDrawable(getDrawable("action_bar"));
 
        // Theme the title 
        setTitle(title);
    } 
 
    /** 
     * Themes the action bar subtitle 
     *  
     * @param subtitle The subtitle to use 
7
CodeRank
This code example shows how to use the following methods:setDisplayHomeAsUpEnabled, setDisplayShowTitleEnabled
		// Must do this before super.onCreate 
		ActivityHelper.readAndSetSettings(this);
		super.onCreate(savedInstanceState);
 
		final ActionBar actionBar = getActionBar();
		actionBar.setDisplayShowTitleEnabled(true);
		actionBar.setDisplayHomeAsUpEnabled(true);
 
		handleIntent(getIntent()); 
	} 
	 
	/** 
	 * To allow child classes to override content 
	 */ 
	protected Fragment getFragment() {
		return FragmentSearch.getInstance(mQuery);
	} 
 
	@AfterViews 
	void loadContent() { 
7
CodeRank
This code example shows how to use the following methods:setDisplayHomeAsUpEnabled, setDisplayShowTitleEnabled, setListNavigationCallbacks, setNavigationMode, setSelectedNavigationItem
        } 
    } 
 
    private void setupActionBar(Bundle savedInstanceState) {
        bar = getActionBar();
        bar.setDisplayHomeAsUpEnabled(true);
        bar.setDisplayShowTitleEnabled(false);
        bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
 
        adapter = new FilterAdapter(this);
        adapter.setTitle(Subreddits.getTitle(this, subreddit));
        bar.setListNavigationCallbacks(adapter, this);
        if (savedInstanceState != null) {
            bar.setSelectedNavigationItem(savedInstanceState.getInt(STATE_NAVIGATION_INDEX));
        } 
    } 
 
    public Loader<AccountResult> onCreateLoader(int id, Bundle args) {
        return new AccountLoader(this, true, false);
    } 
7
CodeRank
This code example shows how to use the following methods:addTab, newTab, setDisplayShowTitleEnabled, setNavigationMode
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        actionBar = getActionBar();
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        actionBar.setDisplayShowTitleEnabled(false);
 
        ActionBar.Tab tab = actionBar.newTab()
                .setText("Images")
                .setTabListener(new TabListener<ImagesFragment>(this, "Images", ImagesFragment.class));
        actionBar.addTab(tab);
 
        tab = actionBar.newTab()
                .setText("Settings")
                .setTabListener(new TabListener<SettingsFragment>(this, "Settings", SettingsFragment.class));
        actionBar.addTab(tab);
 
    } 
 

6
CodeRank
This code example shows how to use the following methods:addTab, newTab, setDisplayShowTitleEnabled, setNavigationMode, setSelectedNavigationItem
 
    private ActionBar actionBar;
 
    private void init_action_bar() { 
        actionBar = getActionBar();
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle("I am new here...");
        actionBar.addTab(actionBar.newTab()
                .setText("Lectures")
                .setTabListener(new TabListener<LectureFragment>(
                        this, "lectures", LectureFragment.class)));
        actionBar.addTab(actionBar.newTab()
                .setText("Map")
                .setTabListener(new TabListener<MapFragment>(
                        this, "map", MapFragment.class)));
        actionBar.addTab(actionBar.newTab()
                .setText("Todo")
                .setTabListener(new TabListener<TodoFragment>(
                        this, "todo", TodoFragment.class)));

6
CodeRank
This code example shows how to use the following methods:addTab, newTab, setDisplayShowHomeEnabled, setDisplayShowTitleEnabled, setNavigationMode
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        final ActionBar bar = getActionBar();
        bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        bar.setDisplayShowHomeEnabled(false);
        bar.setDisplayShowTitleEnabled(false);
 
        bar.addTab(bar
                .newTab()
                .setText("Podcasts")
                .setTabListener(
                        new TabListener<PodcastsFragment>(this, "podcasts", PodcastsFragment.class)));
 
        bar.addTab(bar
                .newTab()
                .setText("Favorite")
                .setTabListener(
                        new TabListener<FavorFragment>(this, "favorite",

6
CodeRank
This code example shows how to use the following methods:newTab, setDisplayShowHomeEnabled, setDisplayShowTitleEnabled, setNavigationMode, setSelectedNavigationItem
        mViewPager.setId(1234);
        setContentView(mViewPager);
 
        // setup action bar for tabs 
        ActionBar actionBar = getActionBar();
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayShowHomeEnabled(false);
 
        mTabsAdapter = new TabsAdapter(this, mViewPager);
        mTabsAdapter.addTab(actionBar.newTab().setText("home"), HomeFragment.class, null);
        mTabsAdapter.addTab(actionBar.newTab().setText("friends"), FriendsListFragment.class, null);
        mTabsAdapter.addTab(actionBar.newTab().setText("about"), AboutFragment.class, null);
 
        // check for last open tab 
        if (savedInstanceState != null) {
            actionBar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
        } 
    } 
 

6
CodeRank
This code example shows how to use the following methods:addTab, newTab, setDisplayShowHomeEnabled, setDisplayShowTitleEnabled, setNavigationMode
 
    private void CreateTabs() 
    { 
        ActionBar actionBar = getActionBar();
        // Hide Actionbar Icon 
        actionBar.setDisplayShowHomeEnabled(false);
        // Hide Actionbar Title 
        actionBar.setDisplayShowTitleEnabled(false);
        // Create Actionbar Tabs 
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
 
        // Set Tab Icon and Titles 
        // Tab1 = actionBar.newTab().setIcon(R.drawable.tab1); 
        Tab1 = actionBar.newTab().setText("Info");
        Tab2 = actionBar.newTab().setText("Obsah");
        Tab3 = actionBar.newTab().setText("Text");
 
        // Set Tab Listeners 
        Tab1.setTabListener(new TabListener(fragmentTab1));
        Tab2.setTabListener(new TabListener(fragmentTab2));

6
CodeRank
This code example shows how to use the following methods:addTab, getTabCount, newTab, setDisplayOptions, setDisplayShowTitleEnabled
	public void onActivityCreated(Bundle savedInstanceState) {
		Log.i("OrderInfoFragment","onActivityCreated");
		activity = getActivity();
//		closeSoftInput(); 
		ActionBar actionBar = activity.getActionBar();
		actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE);
		actionBar.setDisplayShowTitleEnabled(false);
		actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
		currentFragment = this;
		if(actionBar.getTabCount() == 0){
			    if(noCompletedTab == null){
			    	noCompletedTab = actionBar.newTab()
				            .setText("未完成订单")
				            .setTabListener(this);
			    	completedTab = actionBar.newTab()
					        .setText("已完成订单")
					        .setTabListener(this);
			    } 
			    actionBar.addTab(noCompletedTab);
			    actionBar.addTab(completedTab);

6
CodeRank
This code example shows how to use the following methods:addTab, newTab, setDisplayShowHomeEnabled, setDisplayShowTitleEnabled, setNavigationMode
        } 
    } 
     
    public void loadActionBar(){ 
  	  ActionBar actionBar = getActionBar();
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayShowHomeEnabled(true);
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
         
        Tab tab = actionBar
                .newTab()
                .setText("Schedule")
                .setTabListener(new DialogNavTabListener<ScheduleFragment>(this, "schedule", ScheduleFragment.class));
        actionBar.addTab(tab);
         
        tab = actionBar
                .newTab()
                .setText("Courses")
                .setTabListener(new NavTabListener<CourseFragment>(this, "courses", CourseFragment.class));
        actionBar.addTab(tab);

6
CodeRank
setDisplayShowTitleEnabled Method Overview
Set whether an activity title/subtitle should be displayed.
See Code Examples for other Android ActionBar Methods: