Hi
So I'm trying to make a somewhat simple Android application.
A user enters a value in a numberbox.
The program checks if that number is in an array.
If it is, in a textbox it says "Yes" if it isn't, in the same text box it says "No"
public class MainActivity extends AppCompatActivity { private Integer enterDate; private Button btnCheck; private TextView resVal; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); enterDate = (Integer) findViewById(R.id.enterDate); btnCheck = (Button) findViewById(R.id.btnCheck); resVal = (TextView) findViewById(R.id.resVal); btnCheck.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Integer[] array = {1,3,5,7}; Set<Integer> set = new HashSet<Integer>(Arrays.asList(array)); boolean enterDate = set.contains(enterDate); if(enterDate) { resVal.setText("Yes"); }else { resVal.setText("No"); } } } }});
I'm getting three errors:
error: ')' expected
error: illegal start of type
error: reached end of file while parsing
They all point me to the last line of code