Example usage for android.view Window FEATURE_ACTION_BAR

List of usage examples for android.view Window FEATURE_ACTION_BAR

Introduction

In this page you can find the example usage for android.view Window FEATURE_ACTION_BAR.

Prototype

int FEATURE_ACTION_BAR

To view the source code for android.view Window FEATURE_ACTION_BAR.

Click Source Link

Document

Flag for enabling the Action Bar.

Usage

From source file:com.andrada.sitracker.ui.PublicationDetailsActivity.java

@SuppressLint("AppCompatMethod")
@Override//from www  .  j  a  v  a 2s  . c o m
protected void onCreate(Bundle savedInstanceState) {
    //UIUtils.tryTranslateHttpIntent(this);
    //BeamUtils.tryUpdateIntentFromBeam(this);
    if (UIUtils.hasHoneycomb()) {
        requestWindowFeature(Window.FEATURE_ACTION_BAR);
    }

    if (shouldBeFloatingWindow()) {
        setupFloatingWindow();
    }
    super.onCreate(savedInstanceState);

    if (savedInstanceState == null) {
        Uri sessionUri = getIntent().getData();
        //BeamUtils.setBeamSessionUri(this, sessionUri);
    }

    setTitle("");
}

From source file:spring16.cs442.com.obt_chat.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_ACTION_BAR);
    setContentView(R.layout.activity_main);

    if (savedInstanceState == null) {
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        BluetoothChatFragment fragment = new BluetoothChatFragment();
        transaction.replace(R.id.sample_content_fragment, fragment);
        transaction.commit();/*from   ww  w.j  av  a2  s .  c om*/
    }
}

From source file:de.medienDresden.illumina.activity.PreferenceActivity.java

@Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
protected void onCreate(Bundle savedInstanceState) {
    log.info("onCreate");

    mCurrentTheme = getPreferences().getString(Illumina.PREF_THEME, getString(R.string.theme_default));

    setTheme(getResources().getIdentifier(mCurrentTheme, "style", getPackageName()));

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        requestWindowFeature(Window.FEATURE_ACTION_BAR);
    }//w  ww  .ja v  a 2  s  .  c  om

    super.onCreate(savedInstanceState);
    setContentView(R.layout.preference_fragment);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        if (getActionBar() != null) {
            getActionBar().setDisplayHomeAsUpEnabled(true);
        }
    }
}

From source file:com.geenk.fileexplorer.FileExplorerTabActivity.java

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_ACTION_BAR);

    setContentView(R.layout.fragment_pager);
    mViewPager = (ViewPager) findViewById(R.id.pager);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME);

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    //        mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_sd),
    //                FileViewActivity.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_remote), ServerControlActivity.class, null);
    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt(INSTANCESTATE_TAB, 0));
    }//w  ww .  j  a  v a  2s . c  o m
}

From source file:com.hiqes.android.demopermissionsm.ui.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    ActionBar ab = getSupportActionBar();
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    mPager = (ViewPager) findViewById(R.id.pager);
    mAdapter = new FragTabAdapter(getSupportFragmentManager());
    mPager.setAdapter(mAdapter);//from   ww w  . j a  v  a2  s. c o m
    mPager.setOnPageChangeListener(this);

}

From source file:dentex.youtube.downloader.menu.TutorialsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    BugSenseHandler.leaveBreadcrumb("TutorialsActivity_onCreate");
    this.setTitle(R.string.title_activity_tutorials);

    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);

    // Theme init
    Utils.themeInit(this);

    // Language init
    Utils.langInit(this);

    // Load default preferences values
    PreferenceManager.setDefaultValues(this, R.xml.tutorials, false);

    // Display the fragment as the main content.
    getFragmentManager().beginTransaction().replace(android.R.id.content, new TutorialsFragment()).commit();
    setupActionBar();/*from  w ww . ja v a2s  .co m*/
}

From source file:org.noorganization.shoppinglist.view.MainActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    m_presenter = ShoppingListPresenter.getInstance(this);
    if (m_presenter.needsToCreateAList()) {
        m_presenter.createList("Test List");
    }/*from  w  ww . j  a va  2  s  .  com*/

    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_shoppinglist);

    m_listSelector = new Spinner(this);
    m_listSelector.setAdapter(new ListSpinnerAdapter(m_presenter.getLists()));
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setCustomView(m_listSelector);

    updateListDropDown();

    m_listSelector.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
        @Override
        public void onItemSelected(AdapterView<?> _parent, View _view, int _position, long _selectedId) {
            m_presenter.selectList((int) _selectedId);
            // TODO refresh listfragments
        }

        @Override
        public void onNothingSelected(AdapterView<?> _parent) {
        }
    });

}

From source file:de.yazo_games.mensaguthaben.AboutActivity.java

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

    supportRequestWindowFeature(Window.FEATURE_ACTION_BAR);

    setContentView(R.layout.activity_about);
    // Show the Up button in the action bar.
    setupActionBar();/*w w  w .  j  ava2  s .com*/

    showVersion();

    makeLinkClickable(R.id.tvCopyright);
    makeLinkClickable(R.id.tvFarebot);
    makeLinkClickable(R.id.tvSource);
    makeLinkClickable(R.id.tvWebsite);
}

From source file:dentex.youtube.downloader.TutorialsActivity.java

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

    this.setTitle(R.string.title_activity_tutorials);

    settings = getSharedPreferences(PREFS_NAME, 0);

    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);

    // Theme init
    Utils.themeInit(this);

    // Language init
    Utils.langInit(this);

    // Load default preferences values
    PreferenceManager.setDefaultValues(this, R.xml.tutorials, false);

    // Display the fragment as the main content.
    getFragmentManager().beginTransaction().replace(android.R.id.content, new TutorialsFragment()).commit();
    setupActionBar();//from   w  ww  . j  a v a  2  s  .  co m
}

From source file:com.borqs.browser.ComboViewActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.getWindow().addFlags(Window.FEATURE_ACTION_BAR);

    setResult(RESULT_CANCELED);//  w w w.  jav a 2  s. c om
    Bundle extras = getIntent().getExtras();
    Bundle args = extras.getBundle(EXTRA_COMBO_ARGS);
    String svStr = extras.getString(EXTRA_INITIAL_VIEW, null);
    ComboViews startingView = svStr != null ? ComboViews.valueOf(svStr) : ComboViews.Bookmarks;
    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.tab_view);
    setContentView(mViewPager);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    if (BrowserActivity.isTablet(this)) {
        bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO);
        bar.setHomeButtonEnabled(true);
    } else {
        bar.setDisplayOptions(0);
    }

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_bookmarks), BrowserBookmarksPage.class, args);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_history), BrowserHistoryPage.class, args);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_snapshots), BrowserSnapshotPage.class, args);

    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt(STATE_SELECTED_TAB, 0));
    } else {
        switch (startingView) {
        case Bookmarks:
            mViewPager.setCurrentItem(0);
            break;
        case History:
            mViewPager.setCurrentItem(1);
            break;
        case Snapshots:
            mViewPager.setCurrentItem(2);
            break;
        }
    }
}