What does the following code achieve?
Intent intent = new Intent(FirstActivity.this, SecondActivity.class); startActivityForResult(intent);
What does the following code achieve?
Intent intent = new Intent(FirstActivity.this, SecondActivity.class); startActivityForResult(intent);
The code snippet creates an Intent to switch from FirstActivity to SecondActivity and calls startActivityForResult to start the SecondActivity. This implies that the FirstActivity expects a result back from the SecondActivity after it finishes. Hence, it starts a sub-activity that can return a result.
B. Starts a sub-activity