Slide 101
Slide 101 text
4VSGBDF1BDLBHF
࣮αϯϓϧᶃ
// SdkSandboxManagerを取得する
val manager = applicationContext.getSystemService(
SdkSandboxManager::class.java
)
// SurfacePackageを要求する
Handler(Looper.getMainLooper()).post {
val params = Bundle()
params.putInt(EXTRA_WIDTH_IN_PIXELS, mClientView.getWidth())
params.putInt(EXTRA_HEIGHT_IN_PIXELS, mClientView.getHeight())
params.putInt(EXTRA_DISPLAY_ID, getDisplay()?.getDisplayId()!!)
params.putBinder(EXTRA_HOST_TOKEN, mClientView.getHostToken())
manager.requestSurfacePackage(
"com.example.adnetwork",
params,
{ obj: Runnable -> obj.run() },
object : OutcomeReceiver {
override fun onResult(response: Bundle) {
Handler(Looper.getMainLooper()).post {
val surfacePackage: SurfacePackage? = response.getParcelable(
EXTRA_SURFACE_PACKAGE, SurfacePackage::class.java)
mClientView.setChildSurfacePackage(surfacePackage!!)
mClientView.setVisibility(View.VISIBLE)
}
}
override fun onError(error: RequestSurfacePackageException) {}
}
)
}
‣ HFU4ZTUFN4FSWJDF
Ͱ
4EL4BOECPY.BOBHFSΛ
औಘ͢Δ