-2

I strongly appreciate any and all help I can get

API 21

1)My timePicker (named timeSelector) is supposed to be interacted with

2)Then when the button is clicked it is supposed to take the timeSelector's hour and minute into two variables.

However, I am really struggling with it, which is frustrating because it seems relatively straightforward.

Sources I Have Looked At:

My code:

  TimePicker myPick =(TimePicker) findViewById(R.id.timeSelector);
    int myhour = myPick.getCurrentHour();
    int myminute = myPick.getCurrentMinute();

Error Image

I really wanna thank everyone that helps me out in advance. I'm confident that as I learn and practice more that this amateur will become a pro!

Community
  • 1
  • 1
Jackson E
  • 37
  • 1
  • 1
  • 7

1 Answers1

0

Change the import statement for TimePicker class to android.widget.TimePicker, it looks like you have a class with the same name in your project.

diedu
  • 19,277
  • 4
  • 32
  • 49