Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Button btn = (Button) findViewById(R.id.button1);
- final EditText editText = (EditText) findViewById(R.id.editText1);
- btn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Calendar c = Calendar.getInstance();
- int day = c.get(Calendar.DAY_OF_MONTH);
- int month = c.get(Calendar.MONTH);
- int year = c.get(Calendar.YEAR);
- editText.setText(day + "/" + (month + 1) + "/" + year);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement