# 开屏广告

<div align="left"><figure><img src="/files/wsRZ7wvShITeXbQI2EmR" alt=""><figcaption></figcaption></figure></div>

开屏广告为用户应用启动时，进行全屏覆盖展示的广告格式，开屏广告优先级高于应用窗体，可实现用户强制观看与展示，实现初次应用展示，本指南完成开屏广告集成与展示

## 前提

用户完成广告初始化步骤[入门指南](/copy-of-cn/jie-kou-wen-dang/android/kai-shi/ru-men-zhi-nan.md)

## 初始化

在页面`Oncreate`方法中完成控件初始化

```java
 FlashViewControl view = new FlashViewControl();
 view.setNewFlashView(this, "UnitId");
```

## 配置展示窗体

默认开屏广告展示为全屏幕最上层，用户如果不配置当前应用顶部窗体，可能会因为设备顶部权限获取问题导致无法正确展示，推荐用户默认配置

```java
view.setWindow(getWindow());
```

## 广告加载

广告加载后，广告数据加载并处理完成后，自动加载并显示到页面

```java
view.loadAd();
```

## 注意事项

开屏广告为强制引导类型，所以加载时机建议在首个页面进行使用，并且广告加载完成后，用户不可进行点击按键返回，只能在广告进行跳过操作或播放完成后结束广告业务流程，开屏广告默认自动回收，不需要用户手动操作

{% hint style="info" %}
为提高用户开屏体验，广告采用缓存机制，用户初次使用不会进行广告展示，缓存加载后，在后续启动中，可快速展示广告内容
{% endhint %}

## 使用场景

开屏广告采用页面添加方式，脱离activity页面绑定，用户可采用自建开屏页或者首页直接加载，若采用首页加载方式，广告播放完成自动回收与管理，不需要用户操作，若采用自建开屏页模式，用户需根据广告加载回调完成页面关闭，事例如下

```java
view.setListener(new AdListener() {
            @Override
            public void adClose() {
                finish();
            }
        });
```

## 添加广告操作监听

参考[横幅广告](/copy-of-cn/jie-kou-wen-dang/android/guang-gao-ge-shi/heng-fu-guang-gao.md#tian-jia-guang-gao-jian-ting-shi-jian)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.adx3.io/copy-of-cn/jie-kou-wen-dang/android/guang-gao-ge-shi/kai-ping-guang-gao.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
