当前位置: 首页>>代码示例>>Java>>正文


Java ActionBar.setDisplayHomeAsUpEnabled方法代码示例

本文整理汇总了Java中android.app.ActionBar.setDisplayHomeAsUpEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBar.setDisplayHomeAsUpEnabled方法的具体用法?Java ActionBar.setDisplayHomeAsUpEnabled怎么用?Java ActionBar.setDisplayHomeAsUpEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.ActionBar的用法示例。


在下文中一共展示了ActionBar.setDisplayHomeAsUpEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    SettingsTheme.apply(this);

    ActionBar mActionBar = getActionBar();

    if (mActionBar != null) {
        mActionBar.setDisplayHomeAsUpEnabled(true);
    }

    // Display the fragment as the main content.
    getFragmentManager().beginTransaction()
            .replace(android.R.id.content, new LauncherSettingsFragment())
            .commit();
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:18,代码来源:BoardActivity.java

示例2: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    SettingsTheme.apply(this);

    String appVersion = BuildConfig.VERSION_NAME;

    ActionBar mActionBar = getActionBar();

    if (mActionBar != null) {
        mActionBar.setSubtitle(appVersion);
        mActionBar.setDisplayHomeAsUpEnabled(true);
    }

    // Display the fragment as the main content.
    getFragmentManager().beginTransaction()
            .replace(android.R.id.content, new LauncherSettingsFragment())
            .commit();
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:21,代码来源:AboutActivity.java

示例3: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    SettingsTheme.apply(this);

    ActionBar actionBar = getActionBar();

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

    // Display the fragment as the main content.
    getFragmentManager().beginTransaction()
            .replace(android.R.id.content, new LauncherSettingsFragment())
            .commit();
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:18,代码来源:SettingsActivity.java

示例4: onPreferenceTreeClick

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
                                     Preference preference)
{
    boolean result =
        super.onPreferenceTreeClick(preferenceScreen, preference);

    // Set home as up
    if (preference instanceof PreferenceScreen)
    {
        Dialog dialog = ((PreferenceScreen)preference).getDialog();
        ActionBar actionBar = dialog.getActionBar();
        actionBar.setDisplayHomeAsUpEnabled(false);
    }

    return result;
}
 
开发者ID:billthefarmer,项目名称:diary,代码行数:18,代码来源:SettingsFragment.java

示例5: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
    this.setTheme(R.style.SettingsTheme);

    super.onCreate(savedInstanceState);

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setIcon(R.drawable.null_icon);
    if (InterfaceUtils.getTabletMode(this)) {
        addPreferencesFromResource(R.xml.preferences_tab);
    } else {
        addPreferencesFromResource(R.xml.preferences);
    }
}
 
开发者ID:89luca89,项目名称:ThunderMusic,代码行数:17,代码来源:PreferencesActivity.java

示例6: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);

    // Get preferences
    SharedPreferences preferences =
        PreferenceManager.getDefaultSharedPreferences(this);

    boolean darkTheme =
        preferences.getBoolean(Diary.PREF_DARK_THEME, false);

    if (darkTheme)
        setTheme(R.style.AppDarkTheme);

    // Display the fragment as the main content.
    getFragmentManager().beginTransaction()
    .replace(android.R.id.content, new SettingsFragment())
    .commit();

    // Enable back navigation on action bar
    ActionBar actionBar = getActionBar();
    if (actionBar != null)
    {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setTitle(R.string.settings);
    }
}
 
开发者ID:billthefarmer,项目名称:diary,代码行数:29,代码来源:Settings.java

示例7: onCreateOptionsMenu

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    ActionBar actionBar = getActivity().getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.notification_settings);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}
 
开发者ID:RikkaApps,项目名称:FCM-for-Mojo,代码行数:9,代码来源:NotificationSettingsFragment.java

示例8: onCreateOptionsMenu

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    ActionBar actionBar = getActivity().getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.server_settings);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}
 
开发者ID:RikkaApps,项目名称:FCM-for-Mojo,代码行数:9,代码来源:ServerSettingsFragment.java

示例9: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

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

    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}
 
开发者ID:MBach,项目名称:AutoAirplaneMode,代码行数:14,代码来源:SettingsActivity.java

示例10: invoke

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public Varargs invoke(Varargs args) {
    final ActionBar actionBar = LuaViewUtil.getActionBar(getGlobals());
    if (actionBar != null) {
        final boolean showBack = args.optboolean(2, true);
        actionBar.setDisplayHomeAsUpEnabled(showBack);
    }
    return UDNavigation.this;
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:10,代码来源:UDNavigation.java

示例11: invoke

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public Varargs invoke(Varargs args) {
    final ActionBar actionBar = LuaViewUtil.getActionBar(getGlobals());
    if (actionBar != null) {
        final boolean showBack = args.optboolean(2, true);
        actionBar.setDisplayHomeAsUpEnabled(showBack);
    }
    return UDActionBar.this;
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:10,代码来源:UDActionBar.java

示例12: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedState) {
    super.onCreate(savedState);
    final ActionBar actionBar = getActionBar();
    final Intent intent = getIntent();
    if (actionBar != null) {
        mShowHomeAsUp = intent.getBooleanExtra(EXTRA_SHOW_HOME_AS_UP, true);
        actionBar.setDisplayHomeAsUpEnabled(mShowHomeAsUp);
        actionBar.setHomeButtonEnabled(mShowHomeAsUp);
    }
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:12,代码来源:SettingsActivity.java

示例13: setupActionBar

import android.app.ActionBar; //导入方法依赖的package包/类
/**
 * Set up the {@link android.app.ActionBar}, if the API is available.
 */
private void setupActionBar() {
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        // Show the Up button in the action bar.
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}
 
开发者ID:SenorSid,项目名称:SensorDataVisualizer,代码行数:11,代码来源:SettingSensorDataActivity.java

示例14: renderBlockDetail

import android.app.ActionBar; //导入方法依赖的package包/类
private void renderBlockDetail(final BlockInfoEx blockInfo) {
    ListAdapter listAdapter = mListView.getAdapter();
    final DetailAdapter adapter;
    if (listAdapter instanceof DetailAdapter) {
        adapter = (DetailAdapter) listAdapter;
    } else {
        adapter = new DetailAdapter();
        mListView.setAdapter(adapter);
        mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                adapter.toggleRow(position);
            }
        });
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            invalidateOptionsMenu();
            ActionBar actionBar = getActionBar();
            if (actionBar != null) {
                actionBar.setDisplayHomeAsUpEnabled(true);
            }
        }
        mActionButton.setVisibility(VISIBLE);
        mActionButton.setText(R.string.block_canary_ex_delete);
        mActionButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (blockInfo != null) {
                    blockInfo.logFile.delete();
                    mBlockStartTime = null;
                    mBlockInfoEntries.remove(blockInfo);
                    updateUi();
                }
            }
        });
    }
    adapter.update(blockInfo);
    setTitle(getString(R.string.block_canary_ex_class_has_blocked, blockInfo.getBlockRealTime()));
}
 
开发者ID:seiginonakama,项目名称:BlockCanaryEx,代码行数:39,代码来源:DisplayActivity.java

示例15: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_immerse_meme);

    ButterKnife.bind(this);

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

    mVisible = true;

    // Set up the user interaction to manually show or hide the system UI.
    fullscreenMeme.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            toggle();
        }
    });

    Uri memeUri = (Uri) getIntent().getExtras().get("memeUri");

    fullscreenMeme.setImageURI(memeUri);
}
 
开发者ID:daergoth,项目名称:dankbank,代码行数:28,代码来源:ImmerseMemeActivity.java


注:本文中的android.app.ActionBar.setDisplayHomeAsUpEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。