使用收藏整理内容 根据您的偏好保存内容并进行分类。
EventUrlProvider
public class EventUrlProvider
继承自 Object
为请求生成事件跟踪 URL。服务可以根据需要将这些 URL 嵌入到 HTML 输出中。当 HTML 在 ODP WebView 中呈现时,ODP 将拦截对这些 URL 的请求,调用 IsolatedWorker#onEvent(EventInput, java.util.function.Consumer)
,并将返回的输出记录在 EVENTS 表中。
摘要
继承的方法 |
来自类 java.lang.Object
Object
|
clone()
创建并返回此对象的副本。
|
boolean
|
equals(Object obj)
指示其他某个对象是否“等于”此对象。
|
void
|
finalize()
当垃圾回收器确定对该对象不再有引用时,它将在该对象上调用此方法。
|
final Class<?>
|
getClass()
返回此 Object 的运行时类。
|
int
|
hashCode()
返回对象的哈希码值。
|
final void
|
notify()
唤醒等待此对象监视器的单个线程。
|
final void
|
notifyAll()
唤醒等待此对象监视器的所有线程。
|
String
|
toString()
返回对象的字符串表示形式。
|
final void
|
wait(long timeoutMillis, int nanos)
使当前线程等待,直到其被唤醒(通常是通过被 通知 或 中断),或直到经过一定量的实际时间。
|
final void
|
wait(long timeoutMillis)
使当前线程等待,直到其被唤醒(通常是通过被 通知 或 中断),或直到经过一定量的实际时间。
|
final void
|
wait()
使当前线程等待,直到其被唤醒(通常是通过被 通知 或 中断)。
|
|
公共方法
createEventTrackingUrlWithRedirect
public Uri createEventTrackingUrlWithRedirect (PersistableBundle eventParams,
Uri destinationUrl)
创建一个事件跟踪 URL,当其在 ODP webview 中被点击时,该 URL 会重定向到提供的目标 URL。
此方法可能需要几秒钟才能完成,因此只能从工作线程调用。
参数 |
eventParams |
PersistableBundle :事件发生时要传递给 IsolatedWorker#onEvent(EventInput, java.util.function.Consumer) 的数据。此值不能为空 (null )。 |
destinationUrl |
Uri :要重定向到的 URL。此值可能为 null 。 |
返回 |
Uri |
一个可插入到 WebView 中的 ODP 事件 URL。此值不能为空 (null )。 |
createEventTrackingUrlWithResponse
public Uri createEventTrackingUrlWithResponse (PersistableBundle eventParams,
byte[] responseData,
String mimeType)
创建一个返回提供的响应的事件跟踪 URL。如果响应数据不为空,则返回 HTTP 状态码 200 (OK)。如果响应数据为空,则返回 HTTP 状态码 204 (No Content)。
此方法可能需要几秒钟才能完成,因此只能从工作线程调用。
参数 |
eventParams |
PersistableBundle :事件发生时要传递给 IsolatedWorker#onEvent(EventInput, java.util.function.Consumer) 的数据。此值不能为空 (null )。 |
responseData |
byte :在获取 URL 时要返回给 WebView 的内容。此值可能为 null 。 |
mimeType |
String :URL 响应的 Mime 类型。此值可能为 null 。 |
返回 |
Uri |
一个可插入到 WebView 中的 ODP 事件 URL。此值不能为空 (null )。 |
本页面上的内容和代码示例均遵循内容许可中描述的许可。Java 和 OpenJDK 是 Oracle 和/或其附属公司的商标或注册商标。
上次更新时间:UTC 2025-02-10。
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]