//Sacando el texto de los editText y guardandolos en sus variables
d_TaskName = etxt_TaskName.getText().toString();
d_TaskTime = etxt_TaskTime.getText().toString();
d_TaskExp = etxt_TaskExp.getText().toString();
// Guardar nombre de la tarea en TaskName.txt
try {
FileOutputStream fou1 = openFileOutput("TaskName.txt", MODE_WORLD_WRITEABLE);
OutputStreamWriter osw1 = new OutputStreamWriter(fou1);
try {
osw1.write(d_TaskName);
osw1.flush();
osw1.close();
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
//Guardar tiempo que dura la tarea en TaskTime.txt
try {
FileOutputStream fou2 = openFileOutput("TaskTime.txt", MODE_WORLD_WRITEABLE);
OutputStreamWriter osw2 = new OutputStreamWriter(fou2);
try {
osw2.write(d_TaskTime);
osw2.flush();
osw2.close();
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
// Guardar la experiencia de la tarea en TaskExp.txt
try {
FileOutputStream fou3 = openFileOutput("TaskExp.txt", MODE_WORLD_WRITEABLE);
OutputStreamWriter osw3 = new OutputStreamWriter(fou3);
try {
osw3.write(d_TaskExp);
osw3.flush();
osw3.close();
Toast.makeText(getBaseContext(), "Tarea Guardada", Toast.LENGTH_LONG).show();
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
我想从每个页面调用该函数。 但在这种情况下,如果我点击电子邮件页面上的日历,则会使用此代码,然后将其重定向到日历页面,但新的日历功能将无效...
之后,如果我再次点击日历,那么日历将自动进入。