語言

Activity.OnVisibleBehindCanceled 方法

定義

當該活動的半透明活動變得不透明或有其他活動啟動時,會被呼叫。

[Android.Runtime.Register("onVisibleBehindCanceled", "()V", "GetOnVisibleBehindCanceledHandler")]
public virtual void OnVisibleBehindCanceled();
[<Android.Runtime.Register("onVisibleBehindCanceled", "()V", "GetOnVisibleBehindCanceledHandler")>]
abstract member OnVisibleBehindCanceled : unit -> unit
override this.OnVisibleBehindCanceled : unit -> unit
屬性

備註

此方法在 API 等級 26 中被淘汰。 此方法的功能自 Build.VERSION_CODES 日起不再支援。O 並會在未來版本中移除。

當該活動的半透明活動變得不透明或有其他活動啟動時,會被呼叫。 覆寫此方法的活動必須呼叫 super.onVisibleBehindCanceled() 或拋出 SuperNotCalledException。 當此方法被呼叫時,活動有 500 毫秒的時間來釋放可能正在使用的資源,且背景可見。 若該活動在500毫秒內未從此方法返回,系統將銷毀該活動並終止程序,以恢復資源供另一個程序使用。 否則 onStop() 會在 return 後被呼叫。 如果你覆寫此方法,必須呼叫超類別實作。

另請參閱:

Android 參考資料。android.app.Activity.onVisibleBehindCanceled

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於