Example usage for android.app ActionBar setTitle

List of usage examples for android.app ActionBar setTitle

Introduction

In this page you can find the example usage for android.app ActionBar setTitle.

Prototype

public abstract void setTitle(@StringRes int resId);

Source Link

Document

Set the action bar's title.

Usage

From source file:com.app.blockydemo.ui.fragment.AddBrickFragment.java

private void resetActionBar() {
    ActionBar actionBar = getActivity().getActionBar();
    actionBar.setTitle(previousActionBarTitle);
}

From source file:com.pureexe.calinoius.environment.camera.activity.FragmentDisplayActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Intent intent = getIntent();/* w  ww.  ja  va2 s .c o m*/
    String type = intent.getType();
    String start = intent.getExtras().getString(Intent.EXTRA_TEXT);
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle(getFragmentReadableName(start));
    if (type.equals("beepActivity")) {
        if (start.equals("EXIFreadFragment")) {
            getFragmentManager().beginTransaction().replace(R.id.container, new EXIFreadFragment()).commit();
        } else if (start.equals("CompassFragment")) {
            getFragmentManager().beginTransaction().replace(R.id.container, new CompassFragment()).commit();
        } else if (start.equals("SettingPreferenceFragment")) {
            getFragmentManager().beginTransaction().replace(R.id.container, new SettingPreferenceFragment())
                    .commit();
        } else if (start.equals("HelpFragment")) {
            getFragmentManager().beginTransaction().replace(R.id.container, new HelpFragment()).commit();
        } else {
            Toast.makeText(getApplicationContext(), "Not Found Intent : " + start, Toast.LENGTH_SHORT).show();
            finish();
        }
    }
}

From source file:com.plnyyanks.frcnotebook.activities.ViewMatch.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(PreferenceHandler.getTheme());
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_view_match);

    activity = this;
    ActionBar bar = getActionBar();
    bar.setTitle(parentEvent.getEventName() + " - " + parentEvent.getEventYear());
    bar.setSubtitle(eventKey);//from w  w w . j  ava2 s .  c o m
    bar.setDisplayHomeAsUpEnabled(true);

    if (matchKey == null)
        return;

    if (PreferenceHandler.getTheme() == R.style.theme_dark) {
        ImageView nextMatch = (ImageView) findViewById(R.id.next_match);
        nextMatch.setBackgroundResource(R.drawable.ic_action_next_item_dark);
        ImageView prevMatch = (ImageView) findViewById(R.id.prev_match);
        prevMatch.setBackgroundResource(R.drawable.ic_action_previous_item_dark);
    }

    new GetNotesForMatch(this).execute(previousKey, matchKey, nextKey, eventKey);

    if (PreferenceHandler.getFMEnabled()) {
        TextView fieldMonitor = (TextView) findViewById(R.id.field_monitor_link);
        fieldMonitor.setVisibility(View.VISIBLE);
        fieldMonitor.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(activity, FieldMonitorActivity.class);
                startActivity(intent);
            }
        });
    }
}

From source file:com.cyanogenmod.settings.device.DisplaySettings.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.viewPager);//from w  ww.  j a  v a2  s  . c o m
    setContentView(mViewPager);

    final ActionBar bar = getActionBar();
    bar.setTitle(R.string.app_name);
    bar.setDisplayHomeAsUpEnabled(true);

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.category_screen_title), ScreenFragmentActivity.class,
            null);

    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
    }
}

From source file:org.austindroids.austindroidstestapp.MainActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {

    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    ActionBar actionBar = getActionBar();
    actionBar.setSubtitle("Fish App");
    actionBar.setTitle("Fish App");
    actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.fish));
    // Dim navigation buttons on bottom
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
    return true;/*w  w w  .j a  va  2  s. co m*/
}

From source file:li.barter.AbstractBarterLiActivity.java

protected final void setActionBarTitle(final String title) {

    final SpannableString s = new SpannableString(title);
    s.setSpan(new TypefacedSpan(this, TypefaceCache.ALEGREYA_BLACK_ITALIC), 0, s.length(),
            Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

    // Update the action bar title with the TypefaceSpan instance
    final ActionBar actionBar = getActionBar();
    actionBar.setTitle(s);
}

From source file:com.richtodd.android.quiltdesign.app.ThemeEditActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_theme_edit);
    getActionBar().setDisplayHomeAsUpEnabled(true);

    m_themeNameArgument = getIntent().getStringExtra(ARG_THEME_NAME);

    if (savedInstanceState != null) {
        m_saveAsThemeName = savedInstanceState.getString("saveAsThemeName");
    }/*from  w w  w  . j  a v a2  s . c o m*/

    ActionBar ab = getActionBar();
    ab.setTitle("Edit Theme");
    ab.setSubtitle(getCurrentThemeName());

    FragmentManager fm = getFragmentManager();

    // Create color settings fragment.
    {
        Fragment f = fm.findFragmentById(R.id.layout_themeEditFragment);
        if (f == null) {
            f = ThemeEditFragment.create(m_themeNameArgument);
            fm.beginTransaction().add(R.id.layout_themeEditFragment, f).commit();
        }
    }
}

From source file:org.dmfs.webcal.EventsPreviewActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_events_preview);

    if (savedInstanceState == null) {
        FragmentManager fragmentManager = getSupportFragmentManager();
        FragmentTransaction transaction = fragmentManager.beginTransaction();
        transaction.add(R.id.events_preview_fragment_container,
                EventsPreviewDetailFragment.newInstance(mEvent, mCalendarName, mCalendarIconId, mTitle));
        transaction.commit();//from w  ww  .j  ava2 s  . c o m
    }

    ActionBar actionBar = getActionBar();

    if (TextUtils.equals(mTitle, mCalendarName)) {
        actionBar.setTitle(mCalendarName);
        actionBar.setSubtitle(null);
    } else {
        actionBar.setTitle(mCalendarName);
        actionBar.setSubtitle(mTitle);
    }

    // Show the Up button in the action bar.
    getActionBar().setDisplayHomeAsUpEnabled(true);
}

From source file:com.yelinaung.hn.app.ui.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.inject(this);

    ActionBar actionBar = getActionBar();
    assert actionBar != null;
    actionBar.setTitle("Hacker News");

    storyDao = new StoryDao(MainActivity.this);

    mSwipeView.setColorScheme(android.R.color.holo_blue_bright, android.R.color.holo_green_light,
            android.R.color.holo_red_light, android.R.color.holo_orange_light);
    mSwipeView.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override//from w  w  w.  j  a v a2  s  . c om
        public void onRefresh() {
            loadNews();
        }
    });

    mNewsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(stories.get(position).link));
            startActivity(browserIntent);
        }
    });
}

From source file:com.app.blockydemo.ui.fragment.BrickCategoryFragment.java

private void resetActionBar() {
    ActionBar actionBar = getActivity().getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(this.previousActionBarTitle);
}