Skip to content

Add docs about Android file handling via intent filters#865

Merged
luke-whos-here merged 3 commits intoAvaloniaUI:mainfrom
daniel-lerch:intent-filter
Feb 3, 2026
Merged

Add docs about Android file handling via intent filters#865
luke-whos-here merged 3 commits intoAvaloniaUI:mainfrom
daniel-lerch:intent-filter

Conversation

@daniel-lerch
Copy link
Contributor

This pull request adds documentation about a feature implemented in AvaloniaUI/Avalonia#20564.

It is my first time contributing to Avalonia's documentation and I am uncertain whether this is a suitable way to document this feature. However, I am certain it must be documented for developers to find it.

Copy link
Contributor

@luke-whos-here luke-whos-here left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I've made a few suggestions to try and clarify some instructions that felt unclear to me at first, and also to remove some of the commented lines in the samples that I thought were not needed.


2. Attach a listener to the `IAvaloniaActivity.Activated` event. It will be raised with `FileActivatedEventArgs` when the user selected your app to open a file.

3. Forward the received storage items into your application/view model.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Forward the received storage items into your application/view model.
3. Forward the received storage items to your application and view model.
When Android activates your app to open a file, the `HandleIntent` method receives an object containing the files. The handler extracts the files and passes them to your App class, which then passes them to the view model for processing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found your suggestion a bit redundant with step 2 and changed the wording myself.

daniel-lerch and others added 2 commits February 3, 2026 11:47
Co-authored-by: Luke <55367595+luke-whos-here@users.noreply.github.com>
@daniel-lerch
Copy link
Contributor Author

@luke-whos-here Thank you very much for the quick code review. I applied most of your suggested changes and made the explanation of passing the event data to the view model more detailed as the code sample does not include some verbose method overrides which are required to achieve that.

Copy link
Contributor

@luke-whos-here luke-whos-here left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

@luke-whos-here luke-whos-here merged commit 91203dc into AvaloniaUI:main Feb 3, 2026
2 checks passed
@daniel-lerch daniel-lerch deleted the intent-filter branch February 3, 2026 12:43
luke-whos-here added a commit that referenced this pull request Feb 3, 2026
Add docs about Android file handling via intent filters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants