本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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()));
}
示例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);
}