In android, I'm not sure I fully understand class R I am looking through a sudoku example and I have this piece of code:
switch (v.getId()) // the id of the argument passed is evaluated by switch statement { case R.id.about_button: // Intent i = new Intent(this, about.class); startActivity(i); break; // More buttons go here (if any) ... }
I am new to Java, but from what I collect, it looks like it takes input (the touch screen touches the button) and evaluates the argument. Then the case statement is set if the about button is known, and a new interface screen is created, and then transferred to the phone.
Is it correct?
If I understood the essence of this question, why the deal with the class "R"?
Why is it called to recognize the button identifier?
I thought the superclass (in this project) was the SudokuActivity class.
java android sudoku
Skizz Jul 23 '11 at 23:55 2011-07-23 23:55
source share