Conference-app-2020: Implement app shortcuts

Created on 16 Jan 2020  ·  6Comments  ·  Source: DroidKaigi/conference-app-2020

Kind (Required)

welcome contribute

All 6 comments

Hi, I want to try this issue, please.

@syo-sa1982
Thanks! Assigned! 👍

英語で説明するのが難しいので日本語で失礼します。
現状困っている事があります。

Static Shortcutsを下記の内容で実装してアプリアイコンの長押しでショートカットは出現したのですが、「このアプリはインストールされていません」というメッセージが表示して起動しません。

やりたいこととしては、一旦MainActivityを起動してから目的のFragmentに遷移することを想定しています。

android-base/src/main/AndroidManifest.xml

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:name="android.app.shortcuts"
                android:resource="@xml/shortcuts" />
            <nav-graph android:value="@navigation/navigation" />
        </activity>

corecomponent/androidcomponent/src/main/res/xml/shortcuts.xml

    <shortcut
        android:shortcutId="floor_map"
        android:icon="@mipmap/ic_launcher"
        android:shortcutShortLabel="@string/floor_map_shortcut_short_label1">
        <intent
            android:action="android.intent.action.VIEW"
            android:targetPackage="io.github.droidkaigi.confsched2020"
            android:targetClass="io.github.droidkaigi.confsched2020.MainActivity" />
        <categories android:name="android.shortcut.conversation" />
    </shortcut>

また、下記に従ってDynamic shortcutsを実装した際はショートカット自体は機能したのですが、現状MainActivityを起動してから目的のFragmentに遷移する方法が確立できておらず詰まっている状況です。
https://developer.android.com/guide/topics/ui/shortcuts/creating-shortcuts?hl=ja#dynamic

上記、解決策または実装内容でどこが間違っているかなどわかる方いますでしょうか?

How about this method?
Probably make a URL with https://droidkaigi.jp/2020/announcement etc., And implement a deep link with navigation.

    <shortcut
        android:shortcutId="floor_map"
        android:icon="@mipmap/ic_launcher"
        android:shortcutShortLabel="@string/floor_map_shortcut_short_label1">
      <intent
          android:data="https://droidkaigi.jp/2020/announcement"
<deepLink app:uri="https://droidkaigi.jp/2020/announcement" />

@takahirom
Thank you, I'll try🙏

@takahirom
We have implemented the functions we want to implement for the time being. Thank you:)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmatsu picture jmatsu  ·  4Comments

alto-tone picture alto-tone  ·  6Comments

nukka123 picture nukka123  ·  5Comments

FujiKinaga picture FujiKinaga  ·  4Comments

ry-itto picture ry-itto  ·  4Comments