安卓4.4.2系统,桌面设置了快捷方式,屏幕解锁后就没有了?
答案:2 悬赏:50
解决时间 2021-03-13 03:27
- 提问者网友:说不出醉人情话
- 2021-03-12 04:11
安卓4.4.2系统,桌面设置了快捷方式,屏幕解锁后就没有了?
最佳答案
- 二级知识专家网友:湫止没有不同
- 2021-03-12 04:20
android 桌面其实也是个android应用于桌面应用由于有缓存造成的
请按以下方式创建一个桌面图标:
1. 程序启动时主动添加快捷方式到桌面------------>主动添加
2.长按桌面,弹出应用选择窗,拖动应用到桌面---------->被动添加
也可以用代码增加:
public static Intent getShortcutToDesktopIntent(Context context) {
Intent intent = new Intent();
intent.setClass(context, context.getClass());
intent.setAction("android.intent.action.MAIN");
intent.addCategory("android.intent.category.LAUNCHER");
Intent shortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
shortcut.putExtra("duplicate", false); shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME,context.getString(R.string.app_name));// 设置图标 shortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,Intent.ShortcutIconResource.fromContext(context, R.drawable.ic_launcher)); // 设置意图和快捷方式关联程序 shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT,intent);
return shortcut;
}
请按以下方式创建一个桌面图标:
1. 程序启动时主动添加快捷方式到桌面------------>主动添加
2.长按桌面,弹出应用选择窗,拖动应用到桌面---------->被动添加
也可以用代码增加:
public static Intent getShortcutToDesktopIntent(Context context) {
Intent intent = new Intent();
intent.setClass(context, context.getClass());
intent.setAction("android.intent.action.MAIN");
intent.addCategory("android.intent.category.LAUNCHER");
Intent shortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
shortcut.putExtra("duplicate", false); shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME,context.getString(R.string.app_name));// 设置图标 shortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,Intent.ShortcutIconResource.fromContext(context, R.drawable.ic_launcher)); // 设置意图和快捷方式关联程序 shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT,intent);
return shortcut;
}
全部回答
- 1楼网友:错过的是遗憾
- 2021-03-12 05:46
这个问题很难说,就算是同一款手机 也有很多可能,1. 如你使用了不同的主题会造成, 2.你使用了一些清理工具会造成 3. 软件冲突会造成(bug) 更新即可 4 中毒等其他问题?非用360吗?用用uc或者qq都可以把
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯