Skip to content
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

Support setData() #8

Closed
opk12 opened this issue Apr 14, 2022 · 6 comments
Closed

Support setData() #8

opk12 opened this issue Apr 14, 2022 · 6 comments

Comments

@opk12
Copy link

opk12 commented Apr 14, 2022

I want to work around a Matrix Element bug in making shortcuts; I want to choose a custom icon for a shortcut to Firefox Fennec.

I can do both with this app, if it lets me setData() to a custom URI.

// im.vector.app.features.link.LinkHandlerActivity - mozilla.components.feature.pwa.WebAppLauncherActivity
Intent intent = new Intent();
intent.setClassName(packageName, activityName);
intent.setData(android.net.Uri.parse(permalink));
ctx.startActivity(intent);
@sdex
Copy link
Owner

sdex commented Apr 15, 2022

You can create any intent and set the data field to whatever you want.

photo1650005330

@opk12
Copy link
Author

opk12 commented Apr 15, 2022

How to reach that window? On 4.1.4 I have the same screens as here and the dialog Edit shortcut only has the icon and label.

@sdex
Copy link
Owner

sdex commented Apr 15, 2022

You need to open Activity Manager in Activity Manager, then launch IntentBuilderActivity, create the custom intent and launch it. From the history you can create a shortcut for the intent.
photo1650015430

@opk12
Copy link
Author

opk12 commented Apr 15, 2022

For myself: the history is HistoryActivity and is at the top-right in the Intent launcher activity. To create the shortcut, first launch the intent with the V button at the bottom, then long-tap on the history entry.

@opk12
Copy link
Author

opk12 commented Apr 15, 2022

Many thanks. I have not found even a very brief mention in-app, is there a specific reason?

@sdex
Copy link
Owner

sdex commented Apr 15, 2022

This was not a very popular feature and I decided to not support it anymore but didn't want to remove it from the app.
It's neither mentioned in the UI nor documented, but it reflects android API for the Intent, so any android developer can easily use it.

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

No branches or pull requests

2 participants