启动活动和启动子活动
谁能告诉我 startActivity
和 startActivityForResult
之间的区别?
startActivity
是否用于异步调用 Activity
,而 startActivityForResult
是否用于同步调用?
startActivity(intent)
和 startActivityForResult(intent,-1)
相同吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
startActivity()
和startActivityForResult()
都是异步的。Both
startActvity()
andstartActivityForResult()
are ASYNCHRONOUS.Android 中没有
startSubActivity()
。它很久以前就被startActivityForResult()
取代了。There is no
startSubActivity()
in Android. It was replaced a long time ago bystartActivityForResult()
.startSubActivity()
。它很久以前就被startActivityForResult()
取代了。startActivityForResult()
启动一个活动并期望得到一些回报;startActivity()
只是启动一个活动,而不用担心得到任何结果。startActivity()
和startActivityForResult()
都是异步的。startActivity(intent)
和startActivityForResult(intent,-1)
执行相同的操作。startSubActivity()
in Android. It was replaced a long time ago bystartActivityForResult()
.startActivityForResult()
starts an activity and expects something in return;startActivity()
just starts an activity without worrying about getting any result.startActvity()
andstartActivityForResult()
are ASYNCHRONOUS.startActivity(intent)
andstartActivityForResult(intent,-1)
do the same.