语言

Activity.SetResult 方法

定义

重载

名称 说明
SetResult(Result, Intent)

调用此项可设置活动将返回到其调用方的结果。

SetResult(Result)

调用此项可设置活动将返回到其调用方的结果。

SetResult(Result, Intent)

调用此项可设置活动将返回到其调用方的结果。

[Android.Runtime.Register("setResult", "(ILandroid/content/Intent;)V", "")]
public void SetResult(Android.App.Result resultCode, Android.Content.Intent? data);
[<Android.Runtime.Register("setResult", "(ILandroid/content/Intent;)V", "")>]
member this.SetResult : Android.App.Result * Android.Content.Intent -> unit

参数

resultCode
Result

要传播回原始活动的结果代码,通常RESULT_CANCELED或RESULT_OK

data
Intent

要传播回原始活动的数据。

特性

注解

调用此项可设置活动将返回到其调用方的结果。 截至Build.VERSION_CODES。GINGERBREAD,此处提供的意向可以设置Intent.FLAG_GRANT_READ_URI_PERMISSION和/或Intent.FLAG_GRANT_WRITE_URI_PERMISSION。 这将授予接收对意向中特定 URI 的结果访问权限的活动。 访问将一直保留到活动完成(它将在整个托管过程中被终止和其他临时销毁)并将被添加到它已保留的任何现有 URI 权限集中。

Android 参考。android.app.Activity.setResult

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

另请参阅

适用于

SetResult(Result)

调用此项可设置活动将返回到其调用方的结果。

[Android.Runtime.Register("setResult", "(I)V", "")]
public void SetResult(Android.App.Result resultCode);
[<Android.Runtime.Register("setResult", "(I)V", "")>]
member this.SetResult : Android.App.Result -> unit

参数

resultCode
Result

要传播回原始活动的结果代码,通常RESULT_CANCELED或RESULT_OK

特性

注解

调用此项可设置活动将返回到其调用方的结果。

Android 参考。android.app.Activity.setResult

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于