What happens is that in this exercise, I have to enter an hour of entry to each specific query (either with a doctor of general medicine, dentist, dermatologist, etc.), after that I have to add the minutes that I Delay in each query and the result of that sum will give me the time of departure, in this code I do not understand why I have it bad.
I get an error in the line of dtDate=format.parse(edt1.getText());
does not recognize the parse, it comes out in red
Unknown class: 'dtDate', Can not resolve symbol 'parse', Can not resolve symbol 'getText'
These are the 3 errors that appear on this line.
Full Code (MainActivity)
package com.example.asus.example1;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
public class MainActivity extends AppCompatActivity {
EditText edt1;
EditText edt2;
EditText edt3;
TextView t1;
Button btn1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
edt1=(EditText) findViewById(R.id.valor1);
edt2=(EditText) findViewById(R.id.valor2);
t1=(TextView) findViewById(R.id.t1);
}
public static java.util.Date minusDate(java.util.Date fch, int minutos){
Calendar cal=new GregorianCalendar();
cal.setTimeInMillis(fch.getTime());
cal.add(Calendar.MINUTE, -minutos);
return new Date(cal.getTimeInMillis());
}
DateFormat format=new SimpleDateFormat("hh:mm");
java.util.Date dtDate;
dtDate=format.parse(edt1.getText());
}