我使用JodaTime库进行时间操作.我有两个日期:第一天:
DateTime time_server = new DateTime(server_time_milisecs).
withZone(DateTimeZone.forID("Europe/Zurich")); //+0100
Run Code Online (Sandbox Code Playgroud)
显示: 2013-01-27 13:44:42
第二天:
DateTime time_local = new DateTime(DateTime.now()).
withZone(DateTimeZone.getDefault()); //Have "Europe/Moscow" timezone +0400
Run Code Online (Sandbox Code Playgroud)
显示: 2013-01-27 16:41:47
我需要找到包括时区在内的实际间隔
Interval interval = new Interval(time_local, time_server);
Long.toString(interval.toDurationMillis()));
Run Code Online (Sandbox Code Playgroud)
结果:174040毫秒 - 不正确
int secs = Seconds.secondsBetween(time_local,time_server).getSeconds();
Run Code Online (Sandbox Code Playgroud)
结果:174秒不正确
Period period = new Period(time_local, time_server);
Integer.toString(period.getSeconds()) //**Wrong too**
Run Code Online (Sandbox Code Playgroud)
结果必须是:10974秒
我们基于android.hardware.Camera
类创建了一个自定义相机.当我们按下"拍照"按钮时,预期的行为是拍摄照片并在查看屏幕上查看仍拍摄的照片.但是,当我们进入查看屏幕时,相机仍可正常工作/取景器正在显示"实时"拍摄(而不是静态查看).看起来持有人不起作用.
在某些Samsung Galaxy S3
手机上观察到这种情况(GT-I9300
); 但奇怪的是在所有其他模型上一切正常(静止图像出现在评论屏幕中).
我使用Android的AndroidQuery(AQuery)库,我需要使用StringEntity(某个字符串)实体创建PUT请求.
我的代码,出了什么问题?你的建议?我尝试使用没有".header("_ method","PUT")"
HttpEntity entity = null;
try {
entity = new StringEntity(stringData, HTTP.UTF_8);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Map<String, Object> params = new HashMap<String, Object>();
params.put(AQuery.POST_ENTITY, entity);
AQuery aq = new AQuery(this);
aq.progress(pDialog).ajax(url, params, String.class, new AjaxCallback<String>() {
@Override
public void callback(String url, String json, AjaxStatus status) {
if(status.getCode() == 200) {
} else {
}
}
}.header("Content-Type", "application/x-www-form-urlencoded")
.header("_method", "PUT"));
Run Code Online (Sandbox Code Playgroud) 我需要覆盖两个EditText实例的样式.我有两个问题:
1)一个EditText用于输入密码但具有相同的字体.如果我删除password = true它可以工作.默认情况下,字体= sans.
<style name="customEdit" parent="@android:style/Widget.EditText">
<item name="android:password">true</item>
<item name="android:typeface">serif</item> //doesn work.
</style>
Run Code Online (Sandbox Code Playgroud)
2)两个领域都有提示.我需要设置这些提示的颜色; 可能吗?我没有找到这样的东西:android:hintColor ...
<item name="android:textColor">#acacac</item> //works for text only.
Run Code Online (Sandbox Code Playgroud)
我为密码类型尝试了两种变体:
即使在"UI构造函数"中,两者都会自动将字体更改为默认值.