操作栏后退按钮不能在android中工作(Actionbar back button not working in android)
我正在创建一个android应用程序,我需要放回导航,以便当用户单击操作栏的主页按钮时,用户应该移动到我的应用程序的一个屏幕上。但是,操作栏主页按钮没有响应点击事件。 这是我的代码。
public static class PlaceholderFragment extends Fragment { public PlaceholderFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); ActionBar actionBar = getActivity().getActionBar(); actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); return rootView; } } public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.home: Toast.makeText(getApplication(), "Back", Toast.LENGTH_LONG).show(); break; default: break; } return super.onOptionsItemSelected(item); }
I am creating a android app where i need to put back navigation ,so that when user click on action bar's home button user should be moved to one screen back on my app.But action bar home button is not responding to click events. Here is my code.
public static class PlaceholderFragment extends Fragment { public PlaceholderFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); ActionBar actionBar = getActivity().getActionBar(); actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); return rootView; } } public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.home: Toast.makeText(getApplication(), "Back", Toast.LENGTH_LONG).show(); break; default: break; } return super.onOptionsItemSelected(item); }
原文:https://stackoverflow.com/questions/22778902
最满意答案
在SSMS 2005或2008中,右键单击标题:“存储过程”,“表格”等,然后在“过滤器设置”上,然后将“架构”更改为“操作员”为“不包含”或“包含”等,然后设置一个值来过滤它们...
In SSMS 2005 or 2008, right click on the heading: "Stored Procedures", "Tables", etc, then on "Filter Settings", then for the "Schema" change "Operator" to "Does not contain" or "Contains", etc and then set a Value to filter them...
相关问答
更多-
在SSMS 2005或2008中,右键单击标题:“存储过程”,“表格”等,然后在“过滤器设置”上,然后将“架构”更改为“操作员”为“不包含”或“包含”等,然后设置一个值来过滤它们... In SSMS 2005 or 2008, right click on the heading: "Stored Procedures", "Tables", etc, then on "Filter Settings", then for the "Schema" change "Operator" to "Does n ...
-
查找SQL Server 2005 Management Studio的注册表(To Find the registry of SQL Server 2005 Management Studio)[2022-10-12]
SQL 2005 SSMS将其设置存储在 HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell SQL 2008 SSMS将其设置存储在 HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell SQL 2005 SSMS stores its settings at HKEY_CURRENT_USER\Software\M ... -
在SQL Server Management Studio中什么是SQLCMD模式?(In SQL Server Management Studio what is SQLCMD mode?)[2022-01-14]
听起来好像是什么 它是一种让您编写SQLCMD脚本的模式。 从MSDN - 使用查询编辑器编辑SQLCMD脚本 : 要使用数据库引擎查询编辑器编写或编辑SQLCMD脚本,必须启用SQLCMD脚本模式。 在SQL Server Management Studio中,通过查询菜单(查询 - > SQLCMD模式)进行设置。 Exactly what it sounds like. It is a mode that lets you author SQLCMD scripts. From MSDN - Edit ... -
你不能在SQL Server中使用整数字段来做到这一点(我也不会用Varchar推荐它)。 让SQL Server将该字段存储为Identity,然后(假设这是用于显示),在您选择它时格式化数据: SELECT RIGHT('000000' + CONVERT(VARCHAR(6),ID), 6) FROM Table You cannot do this with an integer field in SQL Server (nor would I recommend it with a Varcha ...
-
SQL Server 2008 Management Studio无法识别新架构(SQL Server 2008 Management Studio doesn't recognize new Schema)[2024-01-08]
您可能需要刷新SSMS:如果原始SQL有效。 坦率地说,最简单的方法是在服务器上关闭对象资源管理器并重新打开。 SQL Server客户端工具在重新进入侏罗纪期间存在问题... You may need to refresh SSMS: if raw SQL works. Frankly, the easiest way is to close object explorer on the server and re-open. The SQL Server client tools have a prob ... -
用于SQL Server 2000的SQL Sever Management Studio(SQL Sever Management Studio for SQL Server 2000)[2022-08-15]
SQL Server 2000管理工具包括企业管理器(如Management Studio),查询分析器(一种执行脚本的工具)和Profiler(一种分析查询的工具)。 你可以在SQL Server 2000中连接和使用SQL Management Studio 2005) 或者如果你想要不同的东西,你可以使用EMS SQL管理器 。 SQL Server 2000 Management Tools includes Enterprise Manager (like Management Studio), ... -
我听说过Aqua Data Studio的好消息 。 适用于Win,OSX,Linux和Solaris。 Update: I had to come back and add to this. Navicat has a FREE solution for MySQL and MS SQL server. They are both available (for free) in the mac app store. App store links: Navicat for SQL Server Navic ...
-
SQL Server Management Studio:在视图定义中插入注释(SQL Server Management Studio: insert comment in view definition)[2023-09-29]
这对我有用 - 当我“脚本为 - >创建”时,评论显示出来。 create view [dbo].[v_test] as /* this is my view */ select * from Items This works for me - when I "script as -> create", the comment shows up. create view [dbo].[v_test] as /* this is my view */ select * from Items -
您可以安装SQL Server 2008的Nov CTP。 SSMS支持连接到Azure,就像连接到任何其他内部部署数据库一样。 你也可以尝试这个工具 - http://hanssens.org/tools/sqlazuremanager/ 另一种选择是由Cerebrata提供的工具http://onlinedemo.cerebrata.com/sqlazureclient/ 。 You can install the Nov CTP of SQL Server 2008 . The SSMS suppor ...
-
您已连接到SQL Server的不同实例。 Visual Studio连接到LocalDB实例,而SQL Server Management Studio连接到SQL Server Express实例。 要解决此问题,只需在SQL Server Management Studio工具的登录步骤中选择本地实例。 You are connected to different instances of SQL Server. Visual Studio is connected to a LocalDB inst ...