Example usage for android.app ActionBar setDisplayHomeAsUpEnabled

List of usage examples for android.app ActionBar setDisplayHomeAsUpEnabled

Introduction

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

Prototype

public abstract void setDisplayHomeAsUpEnabled(boolean showHomeAsUp);

Source Link

Document

Set whether home should be displayed as an "up" affordance.

Usage

From source file:com.nexuspad.common.activity.NPNavigateActivity.java

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

    if (mParentActivity == null) {
        mParentActivity = (Class<?>) getIntent().getSerializableExtra(KEY_PARENT_ACTIVITY);
    }/*w  ww  . ja va  2  s.  co  m*/

    if (mParentActivity == null) {
        ParentActivity upAnnotaion = getClass().getAnnotation(ParentActivity.class);
        if (upAnnotaion != null) {
            mParentActivity = upAnnotaion.value();
        }
    }

    if (mParentActivity != null) {
        ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
        }
    }
}

From source file:eu.operando.operandoapp.settings.SettingActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(MainContext.INSTANCE.getSettings().getThemeStyle().themeDeviceDefaultStyle());

    super.onCreate(savedInstanceState);

    getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingPreferenceFragment())
            .commit();//from   www . j  a va  2  s . co m

    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setHomeButtonEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}

From source file:net.lacolaco.smileessence.activity.EditTabActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    UserPreferenceHelper userPreferenceHelper = getPreference();
    setTheme(Themes.getTheme(((Application) getApplication()).getThemeIndex()));
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_edit_list);
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    initializeViews();/* w w w.j  a  v  a2  s .c o m*/
    Logger.debug("EditTabActivity:onCreate");
}

From source file:fm.krui.kruifm.ArticleViewActivity.java

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

    // Show loading view
    showLoadingScreen(true);//from  w  w  w.  j  a  v  a 2 s  .  c  o m

    // Prepare ActionBar
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);

    // Retrieve article object from intent
    Article article = new Article();
    article = (Article) getIntent().getSerializableExtra(article.ARTICLE_INTENT);

    // Instantiate views
    TextView articleTitleTextView = (TextView) findViewById(R.id.view_article_title_textview);
    TextView authorTextView = (TextView) findViewById(R.id.view_article_author_textview);
    TextView articleContentTextView = (TextView) findViewById(R.id.view_article_text_textview);

    // Apply extracted info to views
    articleTitleTextView.setText(article.getTitle());
    authorTextView.setText(getAuthor(article));
    articleContentTextView.setText(Html.fromHtml(getArticleText(article)));

    // Hide loading view
    showLoadingScreen(false);
}

From source file:com.aqnote.app.wifianalyzer.settings.SettingActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    setCustomTheme();//w  ww  .  j  a  va  2 s .  co  m

    super.onCreate(savedInstanceState);

    getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingPreferenceFragment())
            .commit();

    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setHomeButtonEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}

From source file:net.vivekiyer.GAL.CorporateContactRecord.java

@TargetApi(11)
@Override//from   w w w  . jav  a2 s. co m
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.contact_fragment);

    final Bundle b = getIntent().getExtras();

    Contact contact = b.getParcelable("net.vivekiyer.GAL"); //$NON-NLS-1$

    CorporateContactRecordFragment contacts = (CorporateContactRecordFragment) getSupportFragmentManager()
            .findFragmentById(R.id.contact_fragment);
    contacts.setIsDualFrame(false);
    contacts.setContact(contact);

    if (!Utility.isPreHoneycomb()) {
        final ActionBar actionBar = getActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}

From source file:com.jaspersoft.android.jaspermobile.activities.viewer.html.report.ReportHtmlViewerActivity.java

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

    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        scrollableTitleHelper.injectTitle(this, resource.getLabel());
    }//from  w ww.j a v a2 s.  co m

    if (savedInstanceState == null) {
        infoManager.getServerInfo(getSpiceManager(), new ServerInfoManager.InfoCallback() {
            @Override
            public void onInfoReceived(ServerInfoSnapshot serverInfo) {
                commitFragments(serverInfo);
            }
        });
    }
}

From source file:net.lacolaco.smileessence.activity.EditCommandActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    UserPreferenceHelper userPreferenceHelper = new UserPreferenceHelper(this);
    setTheme(Themes.getTheme(((Application) getApplication()).getThemeIndex()));
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_edit_list);
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    initializeViews();/*  ww  w .  j  ava  2  s . com*/
    Logger.debug("EditCommandActivity:onCreate");
}

From source file:org.codecyprus.android_client.ui.ActivityScoreBoard.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_score_board);

    scoreBoardTitle = (TextView) findViewById(R.id.activity_score_board_title);
    listView = (ListView) findViewById(R.id.activity_score_board_list_view);

    final ActionBar actionBar = getActionBar();
    if (actionBar != null)
        actionBar.setDisplayHomeAsUpEnabled(true);

    progressReceiver = new ProgressReceiver();
}

From source file:org.cnx.android.quizcards.activities.CardListActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.card_list);/*from  w ww . j av a  2  s. co m*/

    // Allow going back with ActionBar
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);

    // Hide the keyboard at launch (as EditText will be focused automatically)
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

    // Get UI elements
    cardListView = (ListView) findViewById(R.id.cardListView);

    id = getIntent().getStringExtra(DECK_ID);

    getCards();

    cardListView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long resource_id) {
            cardsCursor.moveToPosition(position);
            int row_id = cardsCursor.getInt(cardsCursor.getColumnIndex(BaseColumns._ID));
            String term = cardsCursor.getString(cardsCursor.getColumnIndex(TERM));
            String meaning = cardsCursor.getString(cardsCursor.getColumnIndex(MEANING));

            Intent cardEditIntent = new Intent(CardListActivity.this, CardEditorActivity.class);
            cardEditIntent.putExtra(BaseColumns._ID, row_id);
            cardEditIntent.putExtra(TERM, term);
            cardEditIntent.putExtra(MEANING, meaning);
            cardEditIntent.putExtra(DECK_ID, id);
            startActivityForResult(cardEditIntent, CARD_EDIT_REQUEST);
        }
    });
}