tags:

views:

25

answers:

1

Hi everyone, Just a small problem really, I'm wanting to place the current year into the footer of my apps. Each footer is a TextView and is seen on menu screens etc. Is there a way to insert the year into this dynamically?

Cheers, Laurence

+1  A: 

You can do something like:

Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);

TextView footer = findViewById(R.id.footer);
footer.setText("" + year);
Erich Douglass
Cheers, shame there no way to do it with XML...
Laurence Dawson