createElement/getElements 等接口产生的 Element 缓存,而不只是某一个元素,调用前请确认没有其他地方还依赖这些缓存。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
清除 Element 的 Android 本地缓存;清除后旧的 Element 对象将无法使用。
createElement/getElements 等接口产生的 Element 缓存,而不只是某一个元素,调用前请确认没有其他地方还依赖这些缓存。
static clearElementCache(): void;
clearElementCache(),宿主环境也可能在资源紧张等情况下自动回收缓存,不要假设缓存会一直保留。如果只是想释放某一个用完的元素,优先使用 recycleElement 或 element.recycle(),避免影响插件里其他还在使用的元素。import { PluginCommAPI } from 'sn-plugin-lib';
/**
* 清空 Element 原生缓存的示例。
*/
export async function exampleClearElementCache() {
PluginCommAPI.clearElementCache();
}