Same as calling startActivityForResult(Intent, int, Bundle) with no options.
Parameters:
intent - The intent to start.
requestCode - If >= 0, this code will be returned in onActivityResult() when the activity exits.
You may want to know when an activity has been returned so that you can perform some type of action.
1. Create an Intent to Open a New Activity/Screen
2. Declare the below class constant. After public class and before the onCreate method.
private static final int ACTIVITY_CREATE=0;
private static final int ACTIVITY_CREATE=0;
3. In the MainActivity.java file, add the code below to the onCreate method.
try {
startActivityForResult(myIntent, ACTIVITY_CREATE);
} catch ( ActivityNotFoundException e) {
e.printStackTrace();
}
e.printStackTrace();
}
4. Compile and run!
Next Recommended Article: onActivityResult - Get the Result of an Activity Upon Return
Resources:
http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)