0

I'm trying to set up a watch using the calendar class. The line:

Calendar mCalendar = new GregorianCalendar(TimeZone.getDefault())

gives me an error:

cannot resolve symbol GregorianCalendar error

What am I doing wrong?

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
kjl
  • 311
  • 3
  • 13
  • .... https://en.m.wikipedia.org/wiki/Conversion_between_Julian_and_Gregorian_calendars – Jay Jul 15 '16 at 21:26

1 Answers1

1

Perhaps you need to add

import java.util.GregorianCalendar;

to the Java class in question?

Sterling
  • 6,365
  • 2
  • 32
  • 40
  • Thank you. I had tried to import android.util.GregorianCalendar. Your suggestion, java.util.GregorianCalendar, fixed the trouble. Thank you! – kjl Jul 16 '16 at 03:29
  • If you're using Android Studio, you might try changing Settings > Editor > General > Auto Import. Also, ctrl-alt-O will optimize your imports for you. – Sterling Jul 16 '16 at 03:45
  • Thank you again. Auto import will help a great deal. As will the auto optimize. – kjl Jul 16 '16 at 03:49