我想写今天今天更改的文字视图日期和第二天的日期?
答案 0 :(得分:0)
如果您想设置TextView以便它始终显示当前日期,您可以这样做:
Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH)+1; //we add one because the months actually start at 0
int day = calendar.get(Calendar.DAY_OF_MONTH);
int year = calendar.get(Calendar.YEAR);
TextView textView = (TextView) findViewById(R.id.your_text_view);
String newText = "Today's Date: "+month+"."+day+"."+year;
textView.setText(newText);