From 1aa8b973cbe7ba509ada794a2e055424912c15fd Mon Sep 17 00:00:00 2001 From: 141605 <1416050140@qq.com> Date: Wed, 23 Apr 2025 17:36:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B5=8B=E8=AF=95002?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Test002.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 Test002.txt diff --git a/Test002.txt b/Test002.txt new file mode 100644 index 0000000..b10fff8 --- /dev/null +++ b/Test002.txt @@ -0,0 +1 @@ +uuu \ No newline at end of file From 5d9d71c13d2a4b2311cf21bf0e1048aff98fd1b0 Mon Sep 17 00:00:00 2001 From: 141605 <1416050140@qq.com> Date: Wed, 23 Apr 2025 17:46:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E8=BF=87=E6=97=B6=E5=87=BD=E6=95=B0shownotification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Notes-master/.idea/.gitignore | 3 +++ Notes-master/.idea/misc.xml | 6 ++++++ Notes-master/.idea/modules.xml | 8 ++++++++ Notes-master/.idea/vcs.xml | 6 ++++++ Notes-master/Notes-master.iml | 11 +++++++++++ .../notes/gtask/remote/GTaskASyncTask.java | 19 ++++++++++--------- Test002.txt => 新建 文本文档.txt | 0 7 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 Notes-master/.idea/.gitignore create mode 100644 Notes-master/.idea/misc.xml create mode 100644 Notes-master/.idea/modules.xml create mode 100644 Notes-master/.idea/vcs.xml create mode 100644 Notes-master/Notes-master.iml rename Test002.txt => 新建 文本文档.txt (100%) diff --git a/Notes-master/.idea/.gitignore b/Notes-master/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/Notes-master/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/Notes-master/.idea/misc.xml b/Notes-master/.idea/misc.xml new file mode 100644 index 0000000..07115cd --- /dev/null +++ b/Notes-master/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Notes-master/.idea/modules.xml b/Notes-master/.idea/modules.xml new file mode 100644 index 0000000..7800270 --- /dev/null +++ b/Notes-master/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Notes-master/.idea/vcs.xml b/Notes-master/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/Notes-master/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Notes-master/Notes-master.iml b/Notes-master/Notes-master.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Notes-master/Notes-master.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Notes-master/src/net/micode/notes/gtask/remote/GTaskASyncTask.java b/Notes-master/src/net/micode/notes/gtask/remote/GTaskASyncTask.java index b3b61e7..a1deb99 100644 --- a/Notes-master/src/net/micode/notes/gtask/remote/GTaskASyncTask.java +++ b/Notes-master/src/net/micode/notes/gtask/remote/GTaskASyncTask.java @@ -64,21 +64,22 @@ public class GTaskASyncTask extends AsyncTask { } private void showNotification(int tickerId, String content) { - Notification notification = new Notification(R.drawable.notification, mContext - .getString(tickerId), System.currentTimeMillis()); - notification.defaults = Notification.DEFAULT_LIGHTS; - notification.flags = Notification.FLAG_AUTO_CANCEL; PendingIntent pendingIntent; if (tickerId != R.string.ticker_success) { pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext, - NotesPreferenceActivity.class), 0); - + NotesPreferenceActivity.class), PendingIntent.FLAG_IMMUTABLE); } else { pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext, - NotesListActivity.class), 0); + NotesListActivity.class), PendingIntent.FLAG_IMMUTABLE); } - notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content, - pendingIntent); + Notification.Builder builder = new Notification.Builder(mContext) + .setAutoCancel(true) + .setContentTitle(mContext.getString(R.string.app_name)) + .setContentText(content) + .setContentIntent(pendingIntent) + .setWhen(System.currentTimeMillis()) + .setOngoing(true); + Notification notification=builder.getNotification(); mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification); } diff --git a/Test002.txt b/新建 文本文档.txt similarity index 100% rename from Test002.txt rename to 新建 文本文档.txt