目录

class info
com.huawei.hms.hmsscankit.RemoteView
控制相机预览和扫码的视图,用于Customized View mode扫码方式

Public Method Summary

Return typeMethod name
voidpublic void onCreate(android.os.Bundle saveInstance)
voidpublic final void onResume()
voidpublic final void onPause()
voidpublic final void onStart()
voidpublic final void onStop()
voidpublic final void onDestroy()
voidpublic void setOnResultCallback(OnResultCallback onResultCallback)
voidpublic void setOnLightVisibleCallback(OnLightVisibleCallBack onLightVisibleCallBack)
booleanpublic boolean switchLight()
booleanpublic boolean getLightStatus()
voidpublic void resumeContinuouslyScan()
voidpublic void pauseContinuouslyScan()


Public Methods

Method
public void onCreate(android.os.Bundle saveInstance)
用于RemoteView的生命周期管理,需要开发者显式调用,通常在发起调用的Activity的同名函数中调用。

Parameters

Parameter nameParameter desc
saveInstance保存上一个状态的变量
Method
public final void onResume()
用于RemoteView的生命周期管理,需要开发者显式调用,通常在发起调用的Activity的同名函数中调用
Method
public final void onPause()
用于RemoteView的生命周期管理,需要开发者显式调用,通常在发起调用的Activity的同名函数中调用
Method
public final void onStart()
用于RemoteView的生命周期管理,需要开发者显式调用,通常在发起调用的Activity的同名函数中调用
Method
public final void onStop()
用于RemoteView的生命周期管理,需要开发者显式调用,通常在发起调用的Activity的同名函数中调用
Method
public final void onDestroy()
用于RemoteView的生命周期管理,需要开发者显式调用,通常在发起调用的Activity的同名函数中调用
Method
public void setOnResultCallback(OnResultCallback onResultCallback)
设置扫码结果回调接口

Parameters

Parameter nameParameter desc
onResultCallback开发者接收结果的接口,由开发者实现
Method
public void setOnLightVisibleCallback(OnLightVisibleCallBack onLightVisibleCallBack)
设置判断环境光亮明暗监听

Parameters

Parameter nameParameter desc
onLightVisibleCallBack根据环境光亮明暗实现回调函数,光线由明亮到暗或由暗到明亮回调,后处理由开发者实现
Method
Method
public boolean switchLight()
切换闪光灯

Return

Typedesc
boolean操作结果
Method
Method
public boolean getLightStatus()
获取闪光灯状态

Return

Typedesc
boolean

闪光灯状态

True:闪光灯开启状态

False:闪光灯关闭状态

Method
Method
public void resumeContinuouslyScan()
恢复扫码
Method
public void pauseContinuouslyScan()
暂停扫码