mirror of
https://github.com/google/pebble.git
synced 2025-03-20 02:51:21 +00:00
1.8 KiB
1.8 KiB
title | description | guide_group | order | related_docs | |
---|---|---|---|---|---|
App Exit Reason | Details on how to use the AppExitReason API | user-interfaces | 1 |
|
Introduced in SDK v4.0, the AppExitReason
API allows developers to provide a
reason when terminating their application. The system uses these reasons to
determine where the user should be sent when the current application terminates.
At present there are only 2 AppExitReason
states when exiting an application,
but this may change in future updates.
APP_EXIT_NOT_SPECIFIED
This is the default state and when the current watchapp terminates. The user is
returned to their previous location. If you do not specify an AppExitReason
,
this state will be used automatically.
static void prv_deinit() {
// Optional, default behavior
// App will exit to the previous location in the system
app_exit_reason_set(APP_EXIT_NOT_SPECIFIED);
}
APP_EXIT_ACTION_PERFORMED_SUCCESSFULLY
This state is primarily provided for developers who are creating one click action applications. When the current watchapp terminates, the user is returned to the default watchface.
static void prv_deinit() {
// App will exit to default watchface
app_exit_reason_set(APP_EXIT_ACTION_PERFORMED_SUCCESSFULLY);
}