前提・実現したいこと
開発環境
android studio 3.6.3
java
api level >= 26
ホーム画面上に、デバイスフォルダー内の任意の画像ファイルのショートカットを作成したい。
発生している問題・エラーメッセージ
ショートカットまでは作成されますが、
タップしても「app isn't installed」となり、
画像が開かない。
該当のソースコード
uri uri="android.resource://[パッケージ名]/drawable/samplegazou"
Intent intent = new Intent(Intent.ACTION_VIEW,uri);
ShortcutInfo shortcut = new ShortcutInfo.Builder(getApplicationContext(), "gazou") .setShortLabel("shortcutName") .setLongLabel("shortcutName") .setIcon(icon) .setIntent(intent) .build(); ShortcutManager shortcutManager = getSystemService(ShortcutManager.class); shortcutManager.requestPinShortcut(shortcut, null);
試したこと
shortcutinfo.buildのintentの使用例をググってみましたが、わかりませんでした。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。