Presentation 类

定义

演示文稿的基类。

[Android.Runtime.Register("android/app/Presentation", DoNotGenerateAcw=true)]
public class Presentation : Android.App.Dialog
[<Android.Runtime.Register("android/app/Presentation", DoNotGenerateAcw=true)>]
type Presentation = class
    inherit Dialog
继承
Presentation
属性

注解

演示文稿的基类。

演示文稿是一种特殊的对话框,目的是在辅助显示器上显示内容。 创建 Presentation 时与目标 Display 相关联,并根据显示的指标配置其上下文和资源配置。

值得注意的是, Context 演示文稿与包含 Activity的上下文不同。 请务必使用演示文稿自己的上下文来扩充演示文稿的布局并加载其他资源,以确保加载目标显示器大小和密度正确的资产。

删除附加到演示文稿的显示时,将自动取消演示文稿(请参阅 Dialog#cancel())。 每当暂停或恢复活动本身时,活动都应注意暂停和恢复演示文稿中播放的任何内容。

<h3>选择演示文稿显示</h3>

在显示 Presentation 之前,必须选择 Display 其显示位置。 选择演示文稿显示有时很困难,因为可能附加了多个显示器。 应用程序应该让系统选择合适的演示文稿显示,而不是尝试猜测哪种显示效果最佳。

有两种主要方法可供选择 Display

<h4>使用媒体路由器选择演示文稿显示</h4>

选择演示文稿显示的最简单方法是使用 android.media.MediaRouter MediaRouter API。 媒体路由器服务跟踪系统上可用的音频和视频路由。 每当选择或未选择路由或首选显示路由更改时,媒体路由器就会发送通知。 因此,应用程序只需监视这些通知,并自动在首选演示文稿显示上显示或消除演示文稿。

首选的演示文稿显示是媒体路由器建议应用程序在辅助显示器上显示内容时应使用的显示器。 有时可能没有首选的演示文稿显示,在这种情况下,应用程序应在本地显示其内容而不使用演示文稿。

下面介绍如何使用媒体路由器在首选演示文稿显示器 android.media.MediaRouter.RouteInfo#getPresentationDisplay()上创建和显示演示文稿。

MediaRouter mediaRouter = (MediaRouter) context.getSystemService(Context.MEDIA_ROUTER_SERVICE);
            MediaRouter.RouteInfo route = mediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
            if (route != null) {
                Display presentationDisplay = route.getPresentationDisplay();
                if (presentationDisplay != null) {
                    Presentation presentation = new MyPresentation(context, presentationDisplay);
                    presentation.show();
                }
            }

以下示例代码 ApiDemos 演示如何使用媒体路由器在主活动中显示内容以及显示演示文稿中的内容(当演示文稿显示可用时)之间自动切换。

{

适用于 . 的 android.app.PresentationJava 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

构造函数

Presentation(Context, Display)

使用默认主题创建附加到指定显示的新演示文稿。

Presentation(Context, Display, Int32)

使用可选的指定主题创建附加到指定显示的新演示文稿。

Presentation(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

属性

ActionBar

ActionBar检索附加到此对话框(如果存在)。

(继承自 Dialog)
Class

返回此 Object的运行时类。

(继承自 Object)
Context

检索运行此对话框的上下文。

(继承自 Dialog)
CurrentFocus

如果此活动返回当前焦点视图,请调用 android.view.Window#getCurrentFocus 窗口。

(继承自 Dialog)
Display

获取 Display 此演示文稿的显示方式。

Handle

基础 Android 实例的句柄。

(继承自 Object)
IsShowing

演示文稿的基类。

(继承自 Dialog)
JniIdentityHashCode

演示文稿的基类。

(继承自 Object)
JniPeerMembers

演示文稿的基类。

LayoutInflater

演示文稿的基类。

(继承自 Dialog)
OnBackInvokedDispatcher

返回 OnBackInvokedDispatcher 与此对话框附加到的窗口关联的实例。

(继承自 Dialog)
OwnerActivity

返回拥有此对话框的活动。 - 或 - 设置拥有此对话框的活动。

(继承自 Dialog)
PeerReference

演示文稿的基类。

(继承自 Object)
Resources

Resources获取应该用于扩充此演示文稿的布局的样式。

SearchEvent

在 onSearchRequested() 回调期间,此函数将返回 SearchEvent 触发回调的函数(如果存在)。

(继承自 Dialog)
ThresholdClass

此 API 支持 Mono for Android 基础结构,不打算直接从代码使用。

ThresholdType

此 API 支持 Mono for Android 基础结构,不打算直接从代码使用。

VolumeControlStream

默认情况下,这将使用所有者活动的建议流类型。

(继承自 Dialog)
Window

检索活动的当前窗口。

(继承自 Dialog)

方法

AddContentView(View, ViewGroup+LayoutParams)

向屏幕添加其他内容视图。

(继承自 Dialog)
Cancel()

取消对话框。

(继承自 Dialog)
Clone()

创建并返回此对象的副本。

(继承自 Object)
CloseOptionsMenu()

演示文稿的基类。

(继承自 Dialog)
Create()

强制立即创建对话。

(继承自 Dialog)
Dismiss()

消除此对话框,将其从屏幕中删除。

(继承自 Dialog)
DispatchGenericMotionEvent(MotionEvent)

调用以处理泛型运动事件。

(继承自 Dialog)
DispatchKeyEvent(KeyEvent)

调用以处理关键事件。

(继承自 Dialog)
DispatchKeyShortcutEvent(KeyEvent)

调用以处理键快捷事件。

(继承自 Dialog)
DispatchPopulateAccessibilityEvent(AccessibilityEvent)

调用以处理 s 的 AccessibilityEvent填充。

(继承自 Dialog)
DispatchTouchEvent(MotionEvent)

调用以处理触摸屏事件。

(继承自 Dialog)
DispatchTrackballEvent(MotionEvent)

调用以处理轨迹球事件。

(继承自 Dialog)
Dispose()

演示文稿的基类。

(继承自 Object)
Dispose(Boolean)

演示文稿的基类。

(继承自 Object)
Equals(Object)

指示其他对象是否“等于”此对象。

(继承自 Object)
FindViewById(Int32)

查找具有给定 ID 的第一个后代视图,或者 null 如果 ID 无效(< 0),层次结构中没有匹配视图,或者尚未完全创建对话框(例如,通过 #show()#create())。

(继承自 Dialog)
FindViewById<T>(Int32)

演示文稿的基类。

(继承自 Dialog)
GetHashCode()

返回对象的哈希代码值。

(继承自 Object)
Hide()

隐藏对话框,但不要将其消除。

(继承自 Dialog)
InvalidateOptionsMenu()

演示文稿的基类。

(继承自 Dialog)
JavaFinalize()

当垃圾回收确定不再引用该对象时,由对象上的垃圾回收器调用。

(继承自 Object)
Notify()

唤醒正在等待此对象的监视器的单个线程。

(继承自 Object)
NotifyAll()

唤醒正在等待此对象的监视器的所有线程。

(继承自 Object)
OnActionModeFinished(ActionMode)

要添加

        Note that if you override this method you should always call through
        to the superclass implementation by calling super.
(继承自 Dialog)
OnActionModeStarted(ActionMode)

要添加

        Note that if you override this method you should always call through
        to the superclass implementation by calling super.
(继承自 Dialog)
OnAttachedToWindow()

当窗口已附加到窗口管理器时调用。

(继承自 Dialog)
OnBackPressed()

当对话框检测到用户按下后退键时调用。

(继承自 Dialog)
OnContentChanged()

每当屏幕的内容视图发生更改(由于调用 M:Android.Views.Window.SetContentView(Android.Views.View,)时调用此挂钩。LayoutParams)AddContentView(View, ViewGroup+LayoutParams)

(继承自 Dialog)
OnContextItemSelected(IMenuItem)

演示文稿的基类。

(继承自 Dialog)
OnContextMenuClosed(IMenu)

演示文稿的基类。

(继承自 Dialog)
OnCreate(Bundle)

Activity#onCreate此方法类似,应在此方法中初始化对话,包括调用 #setContentView

(继承自 Dialog)
OnCreateContextMenu(IContextMenu, View, IContextMenuContextMenuInfo)

生成此视图的上下文菜单时调用。

(继承自 Dialog)
OnCreateOptionsMenu(IMenu)

如果客户端需要此对话框的相同菜单,则通常可以安全地将此调用代理到所有者活动的 Activity#onCreateOptionsMenu(Menu) 调用。

(继承自 Dialog)
OnCreatePanelMenu(Int32, IMenu)

初始化面板“featureId”菜单的内容。

(继承自 Dialog)
OnCreatePanelView(Int32)

实例化视图,以便在“featureId”的面板中显示。

(继承自 Dialog)
OnDetachedFromWindow()

当窗口已附加到窗口管理器时调用。

(继承自 Dialog)
OnDisplayChanged()

当附加演示文稿的属性 Display 已更改时,由系统调用。

OnDisplayRemoved()

在删除演示文稿附加到的系统上时 Display 由系统调用。

OnGenericMotionEvent(MotionEvent)

当对话中的任何视图未处理泛型运动事件时调用。

(继承自 Dialog)
OnKeyDown(Keycode, KeyEvent)

按下了一个键。

(继承自 Dialog)
OnKeyLongPress(Keycode, KeyEvent)

默认实现: KeyEvent.Callback#onKeyLongPress(int, KeyEvent) KeyEvent.Callback.onKeyLongPress()始终返回 false(不处理事件)。

(继承自 Dialog)
OnKeyMultiple(Keycode, Int32, KeyEvent)

默认实现: KeyEvent.Callback#onKeyMultiple(int, int, KeyEvent) KeyEvent.Callback.onKeyMultiple()始终返回 false(不处理事件)。

(继承自 Dialog)
OnKeyShortcut(Keycode, KeyEvent)

当对话框中的任何视图未处理键快捷方式事件时调用。

(继承自 Dialog)
OnKeyUp(Keycode, KeyEvent)

已释放密钥。

(继承自 Dialog)
OnMenuItemSelected(Int32, IMenuItem)

当用户选择了面板的菜单项时调用。

(继承自 Dialog)
OnMenuOpened(Int32, IMenu)

当用户打开面板的菜单时调用。

(继承自 Dialog)
OnOptionsItemSelected(IMenuItem)

演示文稿的基类。

(继承自 Dialog)
OnOptionsMenuClosed(IMenu)

演示文稿的基类。

(继承自 Dialog)
OnPanelClosed(Int32, IMenu)

关闭面板时调用。

(继承自 Dialog)
OnPrepareOptionsMenu(IMenu)

如果客户端需要此对话框的相同菜单,则通常可以安全地将此调用代理到所有者活动的 Activity#onPrepareOptionsMenu(Menu) 调用。

(继承自 Dialog)
OnPreparePanel(Int32, View, IMenu)

准备要显示的面板。

(继承自 Dialog)
OnRestoreInstanceState(Bundle)

从以前保存的捆绑包还原对话框的状态。

(继承自 Dialog)
OnSaveInstanceState()

将对话框的状态保存到捆绑包中。

(继承自 Dialog)
OnSearchRequested()

当用户发出开始搜索的信号时,将调用此挂钩。

(继承自 Dialog)
OnSearchRequested(SearchEvent)

当用户发出开始搜索的信号时,将调用此挂钩。

(继承自 Dialog)
OnStart()

启动对话框时调用。

(继承自 Dialog)
OnStop()

被叫来告诉你你正在停止。

(继承自 Dialog)
OnTouchEvent(MotionEvent)

当触摸屏事件未由其下的任何视图处理时调用。

(继承自 Dialog)
OnTrackballEvent(MotionEvent)

在移动轨迹球时调用,并且未由活动内的任何视图处理。

(继承自 Dialog)
OnWindowAttributesChanged(WindowManagerLayoutParams)

每当当前窗口属性发生更改时,将调用此值。

(继承自 Dialog)
OnWindowFocusChanged(Boolean)

每当窗口焦点发生更改时,将调用此挂钩。

(继承自 Dialog)
OnWindowStartingActionMode(ActionMode+ICallback)

在此窗口启动操作模式时调用。

(继承自 Dialog)
OnWindowStartingActionMode(ActionMode+ICallback, ActionModeType)

演示文稿的基类。

(继承自 Dialog)
OpenContextMenu(View)

演示文稿的基类。

(继承自 Dialog)
OpenOptionsMenu()

演示文稿的基类。

(继承自 Dialog)
RegisterForContextMenu(View)

演示文稿的基类。

(继承自 Dialog)
RequestWindowFeature(Int32)

启用扩展窗口功能。

(继承自 Dialog)
RequireViewById(Int32)

查找具有给定 ID 的第一个后代视图,或者如果 ID 无效(< 0)、层次结构中没有匹配的视图,或者尚未完全创建对话框(例如,通过 #show()#create()) 引发 IllegalArgumentException。

(继承自 Dialog)
SetCancelable(Boolean)

设置此对话框是否可以使用 KeyEvent#KEYCODE_BACK BACK 键取消。

(继承自 Dialog)
SetCanceledOnTouchOutside(Boolean)

设置在窗口边界外触摸时是否取消此对话框。

(继承自 Dialog)
SetCancelMessage(Message)

设置在取消对话框时要发送的消息。

(继承自 Dialog)
SetContentView(Int32)

从布局资源设置屏幕内容。

(继承自 Dialog)
SetContentView(View)

将屏幕内容设置为显式视图。

(继承自 Dialog)
SetContentView(View, ViewGroup+LayoutParams)

从布局资源设置屏幕内容。

(继承自 Dialog)
SetDismissMessage(Message)

设置在关闭对话框时要发送的消息。

(继承自 Dialog)
SetFeatureDrawable(Int32, Drawable)

方便呼叫 android.view.Window#setFeatureDrawable(int, Drawable)

(继承自 Dialog)
SetFeatureDrawableAlpha(Int32, Int32)

方便呼叫 android.view.Window#setFeatureDrawableAlpha

(继承自 Dialog)
SetFeatureDrawableResource(Int32, Int32)

方便呼叫 android.view.Window#setFeatureDrawableResource

(继承自 Dialog)
SetFeatureDrawableUri(Int32, Uri)

方便呼叫 android.view.Window#setFeatureDrawableUri

(继承自 Dialog)
SetHandle(IntPtr, JniHandleOwnership)

设置 Handle 属性。

(继承自 Object)
SetOnCancelListener(IDialogInterfaceOnCancelListener)

设置在取消对话框时要调用的侦听器。

(继承自 Dialog)
SetOnDismissListener(IDialogInterfaceOnDismissListener)

设置在关闭对话框时要调用的侦听器。

(继承自 Dialog)
SetOnKeyListener(IDialogInterfaceOnKeyListener)

设置将密钥调度到对话框时将调用的回调。

(继承自 Dialog)
SetOnShowListener(IDialogInterfaceOnShowListener)

设置在显示对话框时要调用的侦听器。

(继承自 Dialog)
SetTitle(ICharSequence)

设置此对话框窗口的标题文本。

(继承自 Dialog)
SetTitle(Int32)

设置此对话框窗口的标题文本。

(继承自 Dialog)
SetTitle(String)

设置此对话框窗口的标题文本。

(继承自 Dialog)
Show()

启动对话框并在屏幕上显示它。

(继承自 Dialog)
TakeKeyEvents(Boolean)

请求关键事件访问此对话框。

(继承自 Dialog)
ToArray<T>()

演示文稿的基类。

(继承自 Object)
ToString()

返回对象的字符串表示形式。

(继承自 Object)
UnregisterForContextMenu(View)

演示文稿的基类。

(继承自 Dialog)
UnregisterFromRuntime()

演示文稿的基类。

(继承自 Object)
Wait()

使当前线程等待,直到唤醒它,通常是通过 em 通知/em> 或 <em>interrupted</em>。<><

(继承自 Object)
Wait(Int64)

使当前线程等待直到唤醒,通常是通过 <em>通知</em> 或 <em interrupted</em>>,或直到经过一定数量的实时。

(继承自 Object)
Wait(Int64, Int32)

使当前线程等待直到唤醒,通常是通过 <em>通知</em> 或 <em interrupted</em>>,或直到经过一定数量的实时。

(继承自 Object)

事件

CancelEvent

演示文稿的基类。

(继承自 Dialog)
DismissEvent

演示文稿的基类。

(继承自 Dialog)
KeyPress

演示文稿的基类。

(继承自 Dialog)
ShowEvent

演示文稿的基类。

(继承自 Dialog)

显式接口实现

IJavaPeerable.Disposed()

演示文稿的基类。

(继承自 Object)
IJavaPeerable.DisposeUnlessReferenced()

演示文稿的基类。

(继承自 Object)
IJavaPeerable.Finalized()

演示文稿的基类。

(继承自 Object)
IJavaPeerable.JniManagedPeerState

演示文稿的基类。

(继承自 Object)
IJavaPeerable.SetJniIdentityHashCode(Int32)

演示文稿的基类。

(继承自 Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)

演示文稿的基类。

(继承自 Object)
IJavaPeerable.SetPeerReference(JniObjectReference)

演示文稿的基类。

(继承自 Object)

扩展方法

JavaCast<TResult>(IJavaObject)

执行 Android 运行时检查的类型转换。

JavaCast<TResult>(IJavaObject)

演示文稿的基类。

GetJniTypeName(IJavaPeerable)

演示文稿的基类。

适用于