Skip to content

fix(widget): open the tapped note from the note list widget - #3380

Open
mark99i wants to merge 1 commit into
nextcloud:mainfrom
mark99i:fix-open-note-on-click-widget
Open

mark99i wants to merge 1 commit into
nextcloud:mainfrom
mark99i:fix-open-note-on-click-widget

Conversation

@mark99i

@mark99i mark99i commented Oct 8, 2026 •

Copy link
Copy Markdown

The note list widget used WidgetUtil.pendingIntentFlagCompat() for its PendingIntent template, which adds FLAG_IMMUTABLE on Android 14+ (API 34+). An immutable PendingIntent cannot be modified at send time, so the per-item fill-in intent carrying the note id was discarded and EditNoteActivity received an intent without PARAM_NOTE_ID, falling back to creating a new note instead of opening the tapped one.

Use FLAG_MUTABLE explicitly (as SingleNoteWidget already does) so the fill-in intent with the note id is applied, and use the appWidgetId as PendingIntent request code so widget instances no longer share one PendingIntent.

Affected devices: Android 14 and newer (API 34+). On Android 12-13 pendingIntentFlagCompat() returned FLAG_MUTABLE and on Android 11 and below no flag was added, so the fill-in intent worked there.

Partically closes: #3168, #2805

AI-assistant: Cline Extension 1.x (GLM-5.3)

🖼️ Screenshots

🏚️ Before 🏡 After
B A

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

The note list widget used WidgetUtil.pendingIntentFlagCompat() for its
PendingIntent template, which adds FLAG_IMMUTABLE on Android 14+ (API 34+).
An immutable PendingIntent cannot be modified at send time, so the
per-item fill-in intent carrying the note id was discarded and
EditNoteActivity received an intent without PARAM_NOTE_ID, falling back
to creating a new note instead of opening the tapped one.

Use FLAG_MUTABLE explicitly (as SingleNoteWidget already does) so the
fill-in intent with the note id is applied, and use the appWidgetId as
PendingIntent request code so widget instances no longer share one
PendingIntent.

Affected devices: Android 14 and newer (API 34+). On Android 12-13
pendingIntentFlagCompat() returned FLAG_MUTABLE and on Android 11 and
below no flag was added, so the fill-in intent worked there.

AI-assistant: Cline Extension 1.x (GLM-5.3)
Signed-off-by: Mark <mark-smirnow@yandex.ru>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Widget issues

1 participant