https://kotlinlang.org logo
Title
j

Joao Birk

05/11/2020, 2:25 AM
Hi, has anyone used
ShortcutInfo.Builder
with navigation components? It needs an intent, there is no pendingIntent method that I can pass to the Builder, so cant really use
NavDeepLinkBuilder.createPendingIntent().
s

sasikanth

05/11/2020, 2:39 AM
You could try using
NavDeepLinkBuilder.createTaskStackBuilder()
, you can then use
getIntents()
to get the array of intents, if it's a single activity with fragments you can just use the first intent from that array I guess.
j

Joao Birk

05/11/2020, 2:41 AM
Yep, tried that, doesnt work.
s

sasikanth

05/11/2020, 2:44 AM
What was the issue with that?
i

Ian Lake

05/11/2020, 2:53 AM
Yep, can't use Intents with extras (at least with the non-simple ones included by NavDeepLinkBuilder) with shortcuts
The support for actions on deep links added in this last release go really well with shortcuts (since shortcuts require an action): https://developer.android.com/jetpack/androidx/releases/navigation#2.3.0-alpha06
👍 2
j

Joao Birk

05/11/2020, 11:25 AM
Awesome, thank you for the help!
@Ian Lake is there a sample for this?
i

Ian Lake

05/11/2020, 3:27 PM
Not that I know of
👍 1