When I want to get result from start activity, I will use method startActivityForResult(Intent, int).
What is the difference if I pass 0 (zero) as the second parameter and if pass -1 (negative one) as the parameter?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The difference is if you pass a value >= 0, this code will be returned in onActivityResult() when the activity exits and your window will not be displayed until a result is returned back from the started activity.
Otherwise, it is the same as calling startActivity(Intent). (the activity is not launched as a sub-activity)