|
|
@@ -853,10 +853,9 @@ public class SysAppUtil {
|
|
|
PendingIntent successCallback = PendingIntent.getBroadcast(context, 0, pinnedShortcutCallbackIntent, 0);
|
|
|
|
|
|
ShortcutManagerCompat.requestPinShortcut(context, pinShortcutInfo, successCallback.getIntentSender());
|
|
|
- boolean hasShortcut = SysAppUtil.hasShortcut(SheepApp.getInstance(), Config.YF_SHOP_NAME);
|
|
|
- if(hasShortcut)
|
|
|
- G.showToast("添加桌面快捷方式成功");
|
|
|
- return hasShortcut;
|
|
|
+// boolean hasShortcut = SysAppUtil.hasShortcut(SheepApp.getInstance(), Config.YF_SHOP_NAME);
|
|
|
+// return hasShortcut;
|
|
|
+ return SysAppUtil.hasShortcut(SheepApp.getInstance(), Config.YF_SHOP_NAME);
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
@@ -868,6 +867,12 @@ public class SysAppUtil {
|
|
|
showShortcutTip2();
|
|
|
} else {
|
|
|
addShortcutTest(activity);
|
|
|
+ hasShortcut = SysAppUtil.hasShortcut(SheepApp.getInstance(), Config.YF_SHOP_NAME);
|
|
|
+ if(hasShortcut) {
|
|
|
+ showShortcutTip3();
|
|
|
+ } else {
|
|
|
+ showShortcutTip2();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -909,14 +914,6 @@ public class SysAppUtil {
|
|
|
PendingIntent shortcutCallbackIntent = PendingIntent.getBroadcast(activity, 0, new Intent(activity, CallBackReceiver.class), PendingIntent.FLAG_UPDATE_CURRENT);
|
|
|
|
|
|
shortcutManager.requestPinShortcut(info, shortcutCallbackIntent.getIntentSender());
|
|
|
- boolean hasShortcut = SysAppUtil.hasShortcut(SheepApp.getInstance(), Config.YF_SHOP_NAME);
|
|
|
- if(hasShortcut) {
|
|
|
- showShortcutTip3();
|
|
|
- } else {
|
|
|
- showShortcutTip2();
|
|
|
- }
|
|
|
- } else {
|
|
|
- G.showToast("暂不支持");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -983,12 +980,6 @@ public class SysAppUtil {
|
|
|
.build();
|
|
|
//这样就可以通过长按图标显示出快捷方式了
|
|
|
systemService.setDynamicShortcuts(ListUtil.asList(shortcutInfo));
|
|
|
- boolean hasShortcut = SysAppUtil.hasShortcut(SheepApp.getInstance(), Config.YF_SHOP_NAME);
|
|
|
- if(hasShortcut) {
|
|
|
- showShortcutTip3();
|
|
|
- } else {
|
|
|
- showShortcutTip2();
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static void addShortcutTest6(Activity activity) {
|
|
|
@@ -1000,14 +991,6 @@ public class SysAppUtil {
|
|
|
if (!ShortcutSuperUtils.isShortCutExist(activity, mShortcutName, getShortCutIntent(activity))) {
|
|
|
ShortcutUtils.addShortcut(activity, getShortCutIntent(activity), mShortcutName, false,
|
|
|
BitmapFactory.decodeResource(activity.getResources(), R.drawable.icon_yf));
|
|
|
- boolean hasShortcut = SysAppUtil.hasShortcut(SheepApp.getInstance(), Config.YF_SHOP_NAME);
|
|
|
- if(hasShortcut) {
|
|
|
- showShortcutTip3();
|
|
|
- } else {
|
|
|
- showShortcutTip2();
|
|
|
- }
|
|
|
- } else {
|
|
|
- showShortcutTip3();
|
|
|
}
|
|
|
|
|
|
// 为某个包创建快捷方式
|