I am trying to use a spinner and a button in my app. I want to know if my syntax for implementing multiple interfaces is correct. This is how it is currently set up:
public class MainActivity extends AppCompatActivity
implements View.OnClickListener, AdapterView.OnItemSelectedListener
My @Override for the onItemSelectedListener is also not being accepted. I'll post what I have but i will leave out the part that handles what happens after the button is clicked, as I there are no errors there and i believe it has no bearing on this problem:
public class MainActivity extends AppCompatActivity
implements View.OnClickListener, AdapterView.OnItemSelectedListener {
Button setCountdown;
Spinner higestNotification;
EditText countdownTime;
int countdownConversion; //convert contents of countdownTime to an integer
int clockStart = 1;
int[] notificationTimes = new int[7];
String convertNotificationTimeToString;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setCountdown = (Button) findViewById(R.id.setCountdown);
higestNotification = (Spinner) findViewById(R.id.highestNotification);
countdownTime = (EditText) findViewById(R.id.countdownTime);
setCountdown.setEnabled(false);//disable button at the start of the app
higestNotification.setEnabled(false);// disable spinner at the start of the app
countdownTime.setOnClickListener(this);
setCountdown.setOnClickListener(this);
higestNotification.setOnItemSelectedListener(this);
}
@Override
public void OnItemSelected(AdapterView<?> arg0, View arg1, int position, long id )
{
}
@Override
public void OnNothingSelected(AdapterView<?> arg0)
{
}
as i said, the errors are when i try to implement View.OnClickListener and AdapterView.OnItemSelectedListener, as well as the overrides for OnItemSelected