Repository navigation
refactor(android)!: rename lifecycle bindings #1288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Legend-Master
merged 17 commits into
tauri-apps:dev
from
Legend-Master:rename-android-life-cycle-bindings
Jul 28, 2026
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8c13a53
refactor(mobile): move Resumed and Suspended to WindowEvent
lucasfernog f20bd58
move events
lucasfernog c1cd0f5
Merge branch 'dev' into refactor/resumed-events
Legend-Master 9b2612e
Merge branch 'dev' into refactor/resumed-events
Legend-Master ca69bcc
refactor(android)!: rename lifecycle bindings
Legend-Master 60433a7
Document `onNewIntent`
Legend-Master e0cbfa5
Add change file
Legend-Master 9f029ff
Merge branch 'dev' into rename-android-life-cycle-bindings
Legend-Master 204358a
`onLowMemory` does not need the activity
Legend-Master 4aad75e
Remove `onSaveInstanceState`
Legend-Master 46634bb
Update change file
Legend-Master 008a011
Rename `create` to `onFirstActivityCreate`
Legend-Master f9ddbe0
revert unrelated change
Legend-Master 6781895
merge conflict
Legend-Master 5280be1
Merge branch 'dev' into rename-android-life-cycle-bindings
Legend-Master 1d21f26
document main entry point runs after onCreate
Legend-Master 229ae4f
`onFirstActivityCreate` don't take activity
Legend-Master File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| "tao": minor | ||
| --- | ||
|
|
||
| **Breaking Change:** | ||
|
|
||
| Changed the names of the Android JNI lifecycle functions exposed by `android_binding!` as follows: | ||
|
|
||
| - `create` to `onFirstActivityCreate` | ||
| - `onActivityCreate` to `onCreate` | ||
| - `start` to `onStart` | ||
| - `resume` to `onResume` | ||
| - `pause` to `onPause` | ||
| - `stop` to `onStop` | ||
| - Removed `onActivitySaveInstanceState` | ||
| - `onActivityDestroy` to `onDestroy` | ||
| - `onActivityLowMemory` to `onLowMemory` | ||
|
|
||
| `onLowMemory` no longer takes any parameters. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we currently don't give it that in wry - we can i think because the lifecycle owner is the activity
if we were i'm thinking about moving the ndk-context thing into here but it sucks that it's called after the activity's onCreate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do, it should be easier to see after tauri-apps/wry#1790
I don't mind it but I'd probably keep it just for the timing, I could make a comment on the reasons if you want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we don't: https://github.com/tauri-apps/wry/pull/1790/changes#diff-76280dd9be7cec50ab33d778adb7380d01ebfe63a7b5373ee637ef710fe60322R29 - i was talking about the function argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talking about timing, i wonder if we even should use the lifecycle thing or if we just just call it in onActivity if there's a way to have a variable across all activities to check if it has been called already. The incorrect timing here really puts me off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, was testing it in tauri and it worked so didn't notice
Trying something like tauri-apps/wry@11dab6b but I really don't know what java land smokes that if this works. I would honestly say just leave this alone since it didn't cause any problems so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The timing is actually correct I think, we need to run the android entry point after we setup many things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works in the multiwindow example i tested everything else at least
we're talking about https://github.com/tauri-apps/tao/blob/dev/src/platform_impl/android/ndk_glue.rs#L330 and https://github.com/tauri-apps/tao/blob/dev/src/platform_impl/android/ndk_glue.rs#L389 right? to me
createlooks like it wants to run first.I almost want to merge these 2 callbacks, we could do the isFirstActivity check in there instead but i think i'm just going crazy - we can keep everything as is and focus on getting it released instead 😂
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it looks like so but it doesn't and it's probably correct (not semantically, functionally) 😂
I would honestly just leave it to another day, I have documented the timings for now.