startActivityForResult()和startActivity()之间的区别? [英] Difference between startActivityForResult() and startActivity()?
问题描述
什么是 startActivityForResult之间的差值()
和 startActivity()
?
当,为了什么,我应该使用每个人?
When, and for what, should I use each one ?
推荐答案
开始活动,就像你启动应用程序:比如:你有一个主屏和用户信息界面的应用程序:如果您preSS用户信息按钮,启动用户可信息活动与此有关。
startActivity
Start an activity, like you would start an application: for instance: you have an app with a home-screen and a user-info screen: if you press the user-info button, you start the user-info activity with this.
启动活动,并期待回报。例如,您的用户信息屏幕上,您可以上传个人资料图片。你用明确的目标来获得一个URI回来的preferred画面启动画廊活动。你literaly启动该活动取得的结果(图片。有一些techinical的方式,以确保你真正得到的结果,但他们在手册中很清楚的。
Start an activity and expect something in return. For instance, on your user-info screen, you can upload a profile picture. You start the gallery-activity with the explicit goal to get a URI back with the preferred picture. You start this activity literaly to obtain a result (the picture. There are some techinical ways to make sure you actually get the result, but they are quite clear in the manual.
这篇关于startActivityForResult()和startActivity()之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!