tencent cloud

Tencent Cloud Super App as a Service

Closing Mini Programs

Download
Focus Mode
Font Size
Last updated: 2026-07-02 20:09:40
AI-Translated

Closing a specific mini program

Note:
Closing a mini program means only closing its page. When you switch the mini program to the background, it remains in memory, which allows for a quick relaunch with minimal delay.
Note
1. A mini program remains active in memory for 10 minutes after closing.
2. Up to 5 mini programs and 1 mini game can remain active simultaneously.
/**
* Close a mini program
*
* @param context
* @param appId
*/
public static void closeMiniApp(Context context, String appId)
Sample code:
TmfMiniSdk.closeMiniApp(context,appId);

Stopping a specific mini program

Note:
Stopping a mini program means clearing it from memory. The next time it is opened, it will need to be reloaded into memory, which takes more time.
/**
* Stop a mini program
*
* @param context
* @param appId
*/
public static void stopMiniApp(Context context, String appId)
Sample code:
TmfMiniSdk.stopMiniApp(context,appId);

Stopping all mini programs

/**
* Stop all mini programs
*
* @param context
*/
public static void stopAllMiniApp(Context context)
Sample code:
TmfMiniSdk.stopAllMiniApp(context);


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback