public class Activity extends AppCompatActivity {
Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("dd:MMMM:yyyy HH:mm:ss");
String strDate = sdf.format(c.getTime());
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
EscreverData();}
private void EscreverData(){
TextView datas = (TextView) findViewById(R.id.datas);
datas.append(strDate);}}
Here is my code, but, as you can see, the only thing it does is to display, in TextView, the date of entry, of that moment, in the activity. What I really wanted to do was to present the last 5 dates of the activity in TextView without disappearing when I left the application, that is, store them in a list ... If anyone can help me thank you