AlertDialog.Builder的setCancelable
public AlertDialog.Builder setCancelable (boolean cancelable)
Sets whether the dialog is cancelable or not default is true.
设置为false,按返回键不能退出。默认为true。
You only have to… in order to… 你只要……就什么
用法透视
这是一个表示条件的句型,意思是“要想……,只要先……就行了”。
支持范例
You only have to call her in order to know whether she will come or not.
你只要打个电话就知道她是否会来了。I only have to ask the teacher in order to solve the problem.
我只要去问问老师就能解决这个问题了。You only have to get some newspapers in order to find the ads you need.
你只要买一些报纸就能找到你需要的广告了。会话记忆
A: Have you started your report yet?
你开始写报告了吗?B: I’m having a hard time getting the information.
我现在很难搜集信息。A: It’s easy. You only have to search the internet in order to get the information you’re looking for.
这很容易。你只要上网查你需要的信息就行。B: Oh, I didn’t think of that.
噢,我忘了这一点了。小试牛刀:
I only have to ask My LaoDa in order to work out this difficulty.
u only have to kill him in order to be in prison for u.
如下谷歌翻译:u only have to find method and insist on in order to success.
如下谷歌翻译:每日一天口语,轻松超越昨天自己
关注博客
关注更多文章
AlertDialog.Builder的setCancelable
public AlertDialog.Builder setCancelable (boolean cancelable)
Since: API Level 1Sets whether the dialog is cancelable or not default is true.
设置为false,按返回键不能退出。默认为true。
转载于:https://www.cnblogs.com/exmyth/p/4964224.html
whether意为“是否;不管……(还是……)”,表示迟疑或两个可能性之间的选择。whether有以下三种常见表达:
(1) whether to do sth. 意为“是否……”
(2) whether ... or ... 意为“是……,还是……呢?”
(3) whether ... or not 意为“无论……,不管……”
Example: There were times when I wondered whether or not we would get there.
我曾几度怀疑我们能否到达那里。
Example: I didn’t know whether to believe him or not.
我不确定该不该相信他。
Example: She was uncertain whether to stay or leave.
她不确定自己是去是留。
Example: Whether or not we’re successful, we can be sure that we did our best.
不管能否成功,我们真的已经尽力了。
转载于:https://blog.51cto.com/ciscoexpert/2106652
使用Log.isLoggable可以方便的开关log,但是这个方法具体的用法很多人都不知道.
谷歌注释如下:
public static boolean isLoggable(String tag,
int level)
Checks to see whether or not a log for the specified tag is loggable at the specified level. The default level of any tag is set to INFO. This means that any level above and including INFO will be logged. Before you make any calls to a logging method you should check to see if your tag should be logged. You can change the default level by setting a system property: 'setprop log.tag.<YOUR_LOG_TAG> <LEVEL>' Where level is either VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT, or SUPPRESS. SUPPRESS will turn off all logging for your tag. You can also create a local.prop file that with the following in it: 'log.tag.<YOUR_LOG_TAG>=<LEVEL>' and place that in /data/local.prop.
Parameters:
tag - The tag to check.
level - The level to check.
Returns:
Whether or not that this is allowed to be logged.
Throws:IllegalArgumentException - is thrown if the tag.length() > 23 for Nougat (7.0) releases (API <= 23) and prior, there is no tag limit of concern after this API level.
这个方法返回一个boolean值,代码里用这个boolean值做判断是否打印log即可.
手机上使用设置prop的方法来动态修改这个boolean.
比如我声明的boolean值如下:
static final boolean DEBUG = Log.isLoggable("DozeService", Log.DEBUG);
手机上想让这个值变为true的话,用如下的命令即可
adb shell setprop log.tag.DozeService D