目录

class info
com.huawei.hms.hmsscankit.RemoteView
Controls views of camera preview and barcode scanning in 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)
Supports RemoteView lifecycle management. This method requires an explicit call. It is usually called in the function with the same name as an activity that initiates the call.

Parameters

Parameter nameParameter desc
saveInstanceVariable that saves the previous status.
Method
public final void onResume()
Supports RemoteView lifecycle management. This method requires an explicit call. It is usually called in the function with the same name as an activity that initiates the call.
Method
public final void onPause()
Supports RemoteView lifecycle management. This method requires an explicit call. It is usually called in the function with the same name as an activity that initiates the call.
Method
public final void onStart()
Supports RemoteView lifecycle management. This method requires an explicit call. It is usually called in the function with the same name as an activity that initiates the call.
Method
public final void onStop()
Supports RemoteView lifecycle management. This method requires an explicit call. It is usually called in the function with the same name as an activity that initiates the call.
Method
public final void onDestroy()
Supports RemoteView lifecycle management. This method requires an explicit call. It is usually called in the function with the same name as an activity that initiates the call.
Method
public void setOnResultCallback(OnResultCallback onResultCallback)
Sets the barcode scanning result callback interface.

Parameters

Parameter nameParameter desc
onResultCallbackResult receiving interface, which needs to be implemented by developers.
Method

public void setOnLightVisibleCallback(OnLightVisibleCallBack onLightVisibleCallBack)

Sets ambient lightness listening.

Parameters

Parameter nameParameter desc
onLightVisibleCallBackMobile phone flashlight switch interface, which needs to be implemented by developers.
Method
public boolean switchLight()
Switches the flashlight.

Return

Typedesc
booleanOperation result.
Method
Method
public boolean getLightStatus()
Obtains the flashlight status.

Return

Typedesc
booleanFlashlight status.
True: on
False: off
Method
public void resumeContinuouslyScan()
Resumes barcode scanning.
Method
public void pauseContinuouslyScan()
Pauses barcode scanning.