I’m making Sudoku game. There are two classes: difficulty and Screen class. When the ‘easy’ button is pressed, I want to generate a random number from 1 to 9, and that numbers should go to the Screen class layout.
My ‘easy’ button is in choosedifficulty class layout.
Be carefull cause a sudoku is not only “random numbers from 1 to 9”, so I recommend you to implement the algorithm properly. (Take a look at http://en.wikipedia.org/wiki/Sudoku_algorithms).
About passing data from one activity to another, you can use the intent. For example:
And then, to retrieve the data: