1

enter image description hereIs it possible to add dynamic shortcuts directly in "Your shortcuts" tab in Google Assistant App? because as of now I am able to create shortcuts but it is display in "Explore" tab and once I click on "+" icon then that shortcut will move to "Your shortcuts" tab and I can use that shortcut.

I am able to push shortcuts successfully but It display in "Explore" section in Google Assistant App Settings. I want to display it in "Your shortcuts" section.

Here is my code to create shortcuts

ShortcutManagerCompat.pushDynamicShortcut(appContext,createShortcutCompat(task));

private ShortcutInfoCompat createShortcutCompat(Task task) 
{
    Intent intent = new Intent(appContext, DeviceListActivity.class)
            .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setAction(Intent.ACTION_VIEW);
    intent.putExtra(GET_THING_KEY, task.getTitle());

    ShortcutInfoCompat shortcutInfo = new ShortcutInfoCompat.Builder(appContext, task.getId())
            .setShortLabel(task.getTitle())
            .setLongLabel(task.getDescription())
            .addCapabilityBinding("actions.intent.GET_THING", "thing.name", Collections.singletonList(task.getTitle()))
            .setIntent(intent)
            .setLongLived(false)
            .build();

    return shortcutInfo;

}

Amit Soni
  • 71
  • 6

0 Answers0