mcmt:sendToDesktop

zhengkunpeng_branch
zkp 2 years ago
parent 1ef84cc6ad
commit 01fe699084

@ -858,6 +858,13 @@ public class NoteEditActivity extends Activity implements OnClickListener,
return saved;
}
/**
* @method sendToDesktop
* @description 便
* @date: 2023-12-18 17:27
* @author:
* @return void
*/
private void sendToDesktop() {
/**
* Before send message to home, we should make sure that current
@ -869,9 +876,13 @@ public class NoteEditActivity extends Activity implements OnClickListener,
}
if (mWorkingNote.getNoteId() > 0) {
// 新建intent消息为创建桌面快捷方式的连接器
// 2023-12-18 17:29
Intent sender = new Intent();
Intent shortcutIntent = new Intent(this, NoteEditActivity.class);
shortcutIntent.setAction(Intent.ACTION_VIEW);
// 将便签的相关信息添加进intent中
// 2023-12-18 17:36
shortcutIntent.putExtra(Intent.EXTRA_UID, mWorkingNote.getNoteId());
sender.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
sender.putExtra(Intent.EXTRA_SHORTCUT_NAME,
@ -881,6 +892,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
sender.putExtra("duplicate", true);
sender.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
showToast(R.string.info_note_enter_desktop);
// 将便签显示于桌面
// 2023-12-18 17:38
sendBroadcast(sender);
} else {
/**

Loading…
Cancel
Save