Skip to content

Commit

Permalink
fixes #3790 - use path.title
Browse files Browse the repository at this point in the history
  • Loading branch information
VishnuSanal committed May 2, 2023
1 parent 777ea95 commit d853c66
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/src/main/java/com/amaze/filemanager/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -444,16 +444,14 @@ public static void addShortcut(
shortcutIntent.setAction(Intent.ACTION_MAIN);
shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);

String fileName = new File(path.desc).getName();

// Using file path as shortcut id.
ShortcutInfoCompat info =
new ShortcutInfoCompat.Builder(context, path.desc)
.setActivity(componentName)
.setIcon(IconCompat.createWithResource(context, R.mipmap.ic_launcher))
.setIntent(shortcutIntent)
.setLongLabel(fileName)
.setShortLabel(fileName)
.setLongLabel(path.title)
.setShortLabel(path.title)
.build();

ShortcutManagerCompat.requestPinShortcut(context, info, null);
Expand Down

0 comments on commit d853c66

Please sign in to comment.