Link Search Menu Expand Document

Clear Storage

Recent searches and bookings made through the SDK are stored locally on the device. This locally stored data can be cleared prior to starting a CarTrawler flow.


Initialise our CTRecentSearchRepository class as follows:

val context = this.applicationContext
val executor = Executors.newSingleThreadExecutor()
val repository = CTRecentSearchRepository(context, executor)

Call the clearStorage function as follows:

repository.clearStorage()

It’s not possible to clear the storage while the SDK is being presented on screen.