原文地址:
https://stackoverflow.com/a/37185334
I think onSupportNavigateUp() is best and Easiest way to do so
check the code below
if you want it programmatically Add this line in onCreate() method
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Note: make sure Actionbar is not null.
And Override this method
@Override
public boolean onSupportNavigateUp(){
finish();
return true;
}
thats it
OR Non-programmatically you can add meta to the activity in manifest file as
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="MainActivity" />
Other solution:
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onBackPressed();
}
});
分享到:
相关推荐
It describes cable assemblies and adapters to adapt DisplayPort on USB Type-C to other video protocols. It describes the simultaneous use of USB Enhanced SuperSpeed and the DisplayPort protocol on ...
完成带on screen display功能的hotkey,功能和联想的hotkey类似。支持ThinkPad屏幕亮度调节的显示,音量调节,大写键,麦克风,触摸板禁用开启,CPU使用率上升,Fn组合键显示,电池电量等等的显示。支持手动,自动...
Dell-On-Screen-Display-Application,戴尔屏幕显示驱动
+ Added Custom columns - you can extract information from description and display it in event list. + Added alerts by event type. * NewAPI: Event description could be missing for some events. Fixed. *...
在iOS开发中,`searchBar` 和 `searchDisplayController` 是两种重要的组件,它们用于实现应用内的搜索功能,尤其在处理大量数据展示如`tableView`时尤为重要。`searchBar` 提供了一个用户输入搜索关键词的界面,而 ...
在Python的数据库操作中,尤其是当你使用pymysql库连接MySQL数据库时,可能会遇到一个警告,提示"Integer display width is deprecated and will be removed in a future release." 这个警告源于MySQL数据库的一个...
Allows to display an audio bargraph (peak meter and vu meter) of a HD-SD SDI embedded audio signal .
详细定义了各种视频格式(640x480、800x600、1280x720、1280x1024、1920x1080)的时序要求,包括时钟、行同步、场同步信号等,VESA MONITOR TIMING STANDARD。非常好的用户参考资料。
backToTop.style.display = 'block'; } else { backToTop.style.display = 'none'; } }); backToTop.addEventListener('click', function() { window.scrollTo(0, 0); }); ``` 这段代码首先获取了id为“back-...
在网页设计中,按钮(Button)的样式和布局是用户体验中的关键元素。"button自适应高度和自动换行"这个主题主要关注如何让按钮在不同屏幕尺寸和内容长度下保持良好的视觉效果。以下是对这个主题的详细解释: 一、...
display connections include interfaces between a PC and monitor or projector, between a PC and TV, or between a device such as a DVD player and TV display. DP v1.1a was revised to correct errata ...
Connect to the MySQL database and display data obtained from it onto the Qt 5 GUI Incorporate the Qt 5 multimedia and networking module in your application Develop Google Map-like applications using ...
In this Letter, we present a display system based on a curved screen and parallax barrier, which provides stereo images with a horizontal field of view of 360° without wearing any eyewear, to achieve...
DisplayPort_Alt_Mode_on_USB_C_d3.pdf DisplayPort_Alt_Mode_on_USB_C_d3.pdf 文件是关于 DisplayPort Alternate Mode on USB Type-C 的标准文档,下面是该文件中所包含的知识点: DisplayPort Alternate Mode ...
Hands-On Game Development without Coding: Create 2D and 3D games with Visual Scripting in Unity by Lucas Bertolini English | 2018 | ISBN: 1789538335 | 430 Pages | EPUB | 102 MB Develop your own games...
本篇文章将深入探讨如何使用Android原生的`DisplayManager`和`Display`类来实现这一功能。 首先,我们要理解`DisplayManager`和`Display`这两个核心概念。`DisplayManager`是Android提供的一个服务接口,它允许应用...
在网页设计中,按钮(Button)的样式是一个重要的组成部分,它不仅影响页面的美观,还直接关乎用户体验。本文将深入探讨如何使用CSS(层叠样式表)来创建好看且具有吸引力的button样式。 首先,CSS是网页设计中的...
本文档是关于DisplayPort(DP)在USB Type-C上的替代模式(Alt Mode)标准的详细说明,文档编号为v1.0a d1。USB Type-C是近年来广泛使用的可逆式USB接口标准,而DisplayPort是一种高速、高带宽数字视频接口协议。本...
$('#underline-button').on('click', function() { alert('按钮被点击了!'); // 在这里执行其他功能,如数据提交、页面跳转等 }); ``` 综上所述,"带下滑线的button"是一个结合了设计美学和技术实现的UI元素...