tbr*_*lle 10
如果在xml文件中声明了EditText,则必须在这样的代码中检索它
EditText editText = (EditText) findViewById( R.id.your_edittext_id );
Run Code Online (Sandbox Code Playgroud)
然后,您可以使用当前日期轻松更新它
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy/MM/dd" );
editText.setText( sdf.format( new Date() ));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9028 次 |
| 最近记录: |