startActivity and startSubActivity
-
23-02-2021 - |
Question
Can anyone tell me the difference between startActivity
and startActivityForResult
?
Is startActivity
used to call Activity
asynchronously and startActivityForResult
for a synchronous call?
Are startActivity(intent)
and startActivityForResult(intent,-1)
same?
No correct solution
OTHER TIPS
Both startActvity()
and startActivityForResult()
are ASYNCHRONOUS.
There is no startSubActivity()
in Android. It was replaced a long time ago by startActivityForResult()
.
- There is no
startSubActivity()
in Android. It was replaced a long time ago bystartActivityForResult()
. - The difference between them is that:
startActivityForResult()
starts an activity and expects something in return;startActivity()
just starts an activity without worrying about getting any result. - No. Both
startActvity()
andstartActivityForResult()
are ASYNCHRONOUS. - Yes.
startActivity(intent)
andstartActivityForResult(intent,-1)
do the same.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow