Help with exercise in android studio?


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.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;
    protected void onCreate(Bundle savedInstanceState) {
        edt1=(EditText) findViewById(;
        edt2=(EditText) findViewById(;
        t1=(TextView) findViewById(;

   public static java.util.Date minusDate(java.util.Date fch, int minutos){
       Calendar cal=new GregorianCalendar();
       cal.add(Calendar.MINUTE, -minutos);
        return new Date(cal.getTimeInMillis());


    DateFormat format=new SimpleDateFormat("hh:mm");
    java.util.Date dtDate;

asked by nicolasyo1WWE 03.12.2018 в 18:54

0 answers