> For the complete documentation index, see [llms.txt](https://polyv.gitbook.io/document/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polyv.gitbook.io/document/docs/live/android/46-dai-huo-chang-jing-hu-dong.md).

# 4\_6-带货场景-互动

* [1 功能概述](#1-功能概述)
* [2 使用演示](#2-使用演示)

#### 1 功能概述

互动功能包括答题、问卷、公告、抽奖和签到功能。互动功能高度封装，引入简单。具体实现见*核心common-互动*页面。

#### 2 使用演示

带货场景互动功能只需要在`Activity`布局中加入`PLVInteractLayout`，并调用其初始化方法，即可完成集成。

在接收到主播端发起的抽奖等功能时，互动应用界面将会自动显示。

示例代码如下，这里只演示最基本的用法，高级的用法请看*核心common-互动*页面。

```java
// PLVECLiveHomeFragment.java
private void setupInteractLayout(){
    if(interactLayout == null) {
        // 互动应用布局 这里使用了ViewStub
        ViewStub interactLayoutViewStub = findViewById(R.id.plvec_ppt_interact_layout);
        interactLayout = (IPLVInteractLayout) interactLayoutViewStub.inflate();
        // 调用init()方法，完成初始化
        interactLayout.init();
    }
}
```
