|
|
|
@ -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 {
|
|
|
|
|
/**
|
|
|
|
|