Skip to content

Android: add Back button listener #1564

@ambiso

Description

@ambiso

Currently tauri and frameworks that rely on wry/tao such as dioxus don't seem to support receiving back button presses. This could be useful to allow back button navigation within the exposed web-view.

Proposed solution

Receive back button presses in the WryActivity (using androidx's OnBackPressedDispatcher .addCallback) and call a function in the ndk_glue (in tao). A separate crate, that client code can depend on, should expose an API that notifies subscribers of back button presses.

Alternatives

The back button presses could also be directly forwarded to the webview. If the webview has nowhere to go back to, it should close the app.


This issue is similar to #1563, except that it cannot be handled in another activity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions