# StateCallback

abstract class StateCallback<T>(state: StateLayout) : NetCallback<T>
Content copied to clipboard

配合SateLayout布局使用 会在加载成功/错误时显示对应的缺省页 会在页面被销毁时自动取消网络请求

## Constructors

StateCallback
Link copied to clipboard
fun StateCallback(state: StateLayout)
Content copied to clipboard

## Functions

onComplete
Link copied to clipboard
@MainThread()
open override fun onComplete(call: Call, e: Throwable?)
Content copied to clipboard
网络请求完成
onError
Link copied to clipboard
@MainThread()
open override fun onError(call: Call, e: IOException)
Content copied to clipboard
网络请求完成
onFailure
Link copied to clipboard
open override fun onFailure(call: Call, e: IOException)
Content copied to clipboard
网络请求失败, 异步线程
onStart
Link copied to clipboard
@MainThread()
open override fun onStart(request: Request)
Content copied to clipboard
网络请求开始

## Properties

state
Link copied to clipboard
val state: StateLayout
Content copied to clipboard