Android Calendar add day

前端 未结 2 1718
广开言路
广开言路 2021-01-27 03:35

I have an array String populated by data taken from the database. Now for each row of the array I want to add a day to the calendar, the line \"0\" day today, the line \"1\" tom

2条回答
  •  無奈伤痛
    2021-01-27 03:53

    You can just get the time in milliseconds and then add a day worth of milliseconds to it.

    Calendar prova = Calendar.getInstance();
            int size = id_op.length;
            for(int i = 0; i< size; i++){                 
                Long time = prova.getTimeInMillis();
                time = time + 86400000;
                prova.setTimeInMillis(time);           
            }
    

提交回复
热议问题