
# 共享状态变化通知
**接口描述**
该接口用于接收大屏共享状态变化通知。
**注意事项**
1. 用于同步大屏侧的状态变化
2. 随SDK初始化时进行方法重写注册
**方法定义**
```
/**
```
```
* 状态变化通知
```
```
* @param status 连接状态
```
```
* @param reason 原因值
```
```
*/
```
```
void onShareStatusChangedNotify(ShareStatus status, int reason);
```
**参数描述**
| 参数     | 是否必须 | 类型          | 描述                                                                                                                                                                                                        |
|:---|:---|:---|:---|
| status | 是    | ShareStatus | CONNECTED, //连接 SHARING, //共享中 STOPSHARING, //停止共享 DISCONNECT //断连 |
| reason | 是    | int         | 原因值                                                                                                                                                                                                       |
   
**示例代码**
```
shareServiceController =
```
```
ShareServiceController.getInstance().create(this, appInfo, new IShareServiceController.IShareEventHandler() {
```
```
@Override
```
```
public void onRemoteServiceStatusChangedNotify(RemoteServiceStatus remoteServiceStatus) {
```
```
Log.d(TAG, "onRemoteServiceStatusChangedNotify: " + remoteServiceStatus);
```
```
app.setRemoteServiceStatus(remoteServiceStatus);
```
```
app.notifyRemoteServiceStatusChanged(remoteServiceStatus);
```
```
}
```
```
@Override
```
```
public void onShareStatusChangedNotify(ShareStatus shareStatus, int i) {
```
```
Log.d(TAG, "onShareStatusChangedNotify: " + shareStatus);
```
```
app.setShareStatus(shareStatus);
```
```
app.notifyShareStatusChanged(shareStatus);
```
```
}
```
```
});
```
```
LogUtil.d(TAG, "Create SDK object Success !!!!");
```
```
// 存入全局
```
```
app.setShareServiceController(shareServiceController);
```
```
}
```
