Android ActionBarActivity - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ActionBarActivity class.

This code example shows how to use the following methods: getSupportActionBar, onCreate
package com.haarman.listviewanimations; 
 
import android.os.Bundle; 
import android.support.v7.app.ActionBarActivity; 
import android.view.MenuItem; 
 
public class BaseActivity extends ActionBarActivity { 
 
	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		 
		getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
	} 
	 
	 
	@Override 
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home:

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getSupportFragmentManager, getIntent, onCreate, setTheme
public class ChannelListActivity extends ActionBarActivity implements IServerSettings { 
    private String mFileName; 
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
        setTheme(UIUtils.getThemeInt(this)); 
 
        super.onCreate(savedInstanceState); 
 
        mFileName = getIntent().getStringExtra("filename"); 
 
        getSupportFragmentManager().beginTransaction().replace(android.R.id.content, 
                new ChannelListFragment()).commit(); 
    } 
 
    @Override 
    public String getFileName() { 
        return mFileName; 
    } 
 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getSupportFragmentManager, onRestoreInstanceState
        updateFragmentVisibility(); 
    } 
 
    @Override 
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        // Make sure fragments are updated after check box view state is restored. 
        updateFragmentVisibility(); 
    } 
 
    // Update fragment visibility based on current check box state. 
    void updateFragmentVisibility() { 
        // Update top level fragments. 
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        if (mCheckBox1.isChecked()) ft.show(mFragment1);
        else ft.hide(mFragment1);
        if (mCheckBox2.isChecked()) ft.show(mFragment2);
        else ft.hide(mFragment2);
        ft.commit();
 
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
/** 
 * This demonstrates the basics of the Action Bar and how it interoperates with the 
 * standard options menu. This demo is for informative purposes only; see ActionBarUsage for 
 * an example of using the Action Bar in a more idiomatic manner. 
 */ 
public class ActionBarMechanics extends ActionBarActivity { 
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        // The Action Bar is a window feature. The feature must be requested 
        // before setting a content view. Normally this is set automatically 
        // by your Activity's theme in your manifest. The provided system 
        // theme Theme.WithActionBar enables this for you. Use it as you would 
        // use Theme.NoTitleBar. You can add an Action Bar to your own themes 
        // by adding the element <item name="android:windowActionBar">true</item> 
        // to your style definition. 
        supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR); 
    } 
 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getSupportActionBar, getIntent, onCreate, setTitle
 */ 
public abstract class SimpleFragmentActivity extends ActionBarActivity { 
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        ActionBar actionBar = getSupportActionBar();
        actionBar.setHomeButtonEnabled(true);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
         
        if (getIntent().hasExtra("title")) { 
            setTitle(getIntent().getStringExtra("title")); 
        } 
         
        if (savedInstanceState == null) {
            // During initial setup, plug in the details fragment. 
            Fragment fragment = createFragment();
            fragment.setArguments(getIntent().getExtras());
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Android ActionBarActivity Methods: