我想开发一个application
来获取有时间的位置。所以我一直在编写使用TextClock标签显示Time
的代码。我需要在Time
标记中显示TextView
才能存储。
这个过程的方法是什么?
答案 0 :(得分:0)
谢谢。 我找到了解决问题的方法。
`
private String getDateTime() {
java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss", Locale.getDefault());
Date date = new Date();
return dateFormat.format(date);
}
public void onLocationChanged(Location location) {
tv.setText(getDateTime()+"Lat" + location.getLatitude() + "Lon" + location.getLongitude());
}
`