onDestroy()

The onDestroy() method is used to destroy the instance and release all associated resources.

Method signature

copy
public void onDestroy()

Parameters

This method takes no input parameters.

Return value

This method does not return any value.

Usage scenarios

Manual call

In the following cases, call this method to release SDK component resources:

Automatic release

In the following cases, the SDK automatically releases resources:

  • When the buyer initiates multiple payments or card binding attempts and the parameters in AMSBaseConfiguration have not changed, the SDK will automatically recycle some resources after payment or card binding completion to reset to the state before createComponent().