語言

ActivityManager.IsActivityStartAllowedOnDisplay 方法

定義

檢查上下文是否允許在指定的顯示上啟動活動。

[Android.Runtime.Register("isActivityStartAllowedOnDisplay", "(Landroid/content/Context;ILandroid/content/Intent;)Z", "GetIsActivityStartAllowedOnDisplay_Landroid_content_Context_ILandroid_content_Intent_Handler", ApiSince=29)]
public virtual bool IsActivityStartAllowedOnDisplay(Android.Content.Context context, int displayId, Android.Content.Intent intent);
[<Android.Runtime.Register("isActivityStartAllowedOnDisplay", "(Landroid/content/Context;ILandroid/content/Intent;)Z", "GetIsActivityStartAllowedOnDisplay_Landroid_content_Context_ILandroid_content_Intent_Handler", ApiSince=29)>]
abstract member IsActivityStartAllowedOnDisplay : Android.Content.Context * int * Android.Content.Intent -> bool
override this.IsActivityStartAllowedOnDisplay : Android.Content.Context * int * Android.Content.Intent -> bool

參數

context
Context

來源上下文,活動將從中開始。

displayId
Int32

目標顯示ID。

intent
Intent

意圖用於啟動活動。

傳回

true 若在目標顯示器上呼叫啟動活動,且在所提供上下文 SecurityException 中不會拋出,否則不會拋 false 出。

屬性

備註

檢查上下文是否允許在指定的顯示上啟動活動。 部分啟動限制可能適用於私有、虛擬或系統擁有的次要顯示器,若活動開始時會拋出安全異常。 在啟動次要顯示器活動前,先呼叫此方法,確認當前情境是否能存取該資訊。

另請參閱:

Android 參考資料。android.app.ActivityManager.isActivityStartAllowedOnDisplay

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

適用於