Activity.SetResult 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
SetResult(Result) |
呼叫這個 ,以設定活動將返回其呼叫端的結果。 |
SetResult(Result, Intent) |
呼叫這個 ,以設定活動將返回其呼叫端的結果。 |
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.app.Activity.setResult(int)
JAVA 檔。
此頁面的部分是根據 原始碼專案所建立和共用的工作進行修改,並根據中所述的詞彙使用。
另請參閱
- <xref:Android.App.Activity.SetResult(Android.App.Result%2c+Android.Content.Intent)>
適用於
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
要傳播回原始活動的資料。
- 屬性
備註
呼叫這個 ,以設定活動將返回其呼叫端的結果。
從 開始 android.os.Build.VERSION_CODES#GINGERBREAD
,您在這裡提供的意圖可以有 Intent#FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_READ_URI_PERMISSION
和/或 Intent#FLAG_GRANT_WRITE_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION
設定。 這會授與活動,以接收意圖中特定 URI 的結果存取權。 存取權會維持在活動完成之前, (該活動會保留在正在終止的裝載進程中,而其他暫時解構) ,並且會新增至它已保留的任何現有 URI 許可權集。
的 android.app.Activity.setResult(int, android.content.Intent)
JAVA 檔。
此頁面的部分是根據 原始碼專案所建立和共用的工作進行修改,並根據中所述的詞彙使用。