我有这个代码。我需要将string
“horaTarefa HH:MM”转换为int
“hour = HH”和int
“minute = MM”
我想我可以用"dateTarefa DD/MM/YYYY"做同样的事情吗?
SQLiteDatabase db;
db = openOrCreateDatabase("AgendadorTarefas.db",SQLiteDatabase.CREATE_IF_NECESSARY,null); { }
Cursor c = db.query("Tarefa", new String[] {
"codTarefa", "dateTarefa", "horaTarefa", "textoTarefa"},
null, null, null, null, null);
c.moveToFirst();
final ArrayList<String> result = new ArrayList<String>();
while(c.moveToNext())
{
String Date = c.getString(1);
String Hora = c.getString(2);
String Texto = c.getString(3);
result.add(Data + " às " + Hora + " \n" + Texto);
}
hour = Calendar.HOUR;
minute = Calendar.MINUTE;
c.close();