i want to show string one activity to another activity another activity is the sudoku game class and want to show the string like a sudoku puzzle on the sudoku screen board on the sudoku game class.sudoku grid is 9*9.
Asked
Active
Viewed 177 times
1 Answers
0
In the parent Activity I would create an Intent to the Child activity. Then use putExtra to send data. Then use getExtra or any variation on that to get the String. I have used getStringExtra in this example.
Intent childActivity = new Intent(this, Child.class);
childActivity.putExtra("parent_parameter", "This String is for child");
startActivity(childActivity);
In the Child.java Activity.
Intent childIntent = getIntent();
String fromParent = childIntent.data.getStringExtra("parent_parameter");

kensen john
- 5,439
- 5
- 28
- 36
-
whats the point in repeating an answer thats already been given twice? I only added mine to show him some example code! – Kenny Jul 16 '11 at 13:01