Skip to content

Migrate Start an Activity from a Notification snippets - #1129

Open
hamen wants to merge 2 commits into
android:mainfrom
hamen:hamen/notification-navigation
Open

hamen wants to merge 2 commits into
android:mainfrom
hamen:hamen/notification-navigation

Conversation

@hamen

@hamen hamen commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Code snippets are for:

List of modifications:

  • Navigation page (android_notification_navigation_regular_pending_intent): Migrated the regular activity TaskStackBuilder and PendingIntent Kotlin snippet to NotificationNavigation.kt. 12 lines against the page's 10 (spotlessApply expanded the 2-line getPendingIntent(...) call to 4 lines; all other lines and comments are verbatim).
  • Navigation page (android_notification_navigation_regular_notify): Migrated the NotificationCompat.Builder and NotificationManagerCompat.notify Kotlin snippet for regular activities. 7/7 lines match (... whole-line elision converted to // ... comment per D22/D26c without exclude blocks; spotlessApply moved nothing).
  • Navigation page (android_notification_navigation_special_pending_intent): Migrated the special activity Intent (FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_CLEAR_TASK) and PendingIntent.getActivity Kotlin snippet. 7/7 lines match (spotlessApply normalized the 8-space continuation indent inside PendingIntent.getActivity(...) to 4 spaces).
  • Navigation page (android_notification_navigation_special_notify): Migrated the NotificationCompat.Builder and NotificationManagerCompat.notify Kotlin snippet for special activities. 7/7 lines match (... whole-line elision converted to // ... comment per D22/D26c without exclude blocks; spotlessApply moved nothing).

Snippets not migrated:

  • Line 51 (AndroidManifest.xml <activity> hierarchy with android:parentActivityName=".MainActivity"): Left hardcoded on the page because it is an AndroidManifest.xml snippet.
  • Line 96, Line 130, Line 218, and Line 247 (Java blocks): Removed from the page per Kotlin-first guidelines (D15).
  • Line 174 (AndroidManifest.xml <activity> element with android:launchMode="singleTask", android:taskAffinity="", and android:excludeFromRecents="true"): Left hardcoded on the page because it is an AndroidManifest.xml snippet.

@hamen
hamen marked this pull request as ready for review September 22, 2026 14:04
@hamen
hamen requested a review from a team as a code owner September 22, 2026 14:04
@hamen
hamen requested a review from rebeccasg September 22, 2026 14:04
@snippet-bot

snippet-bot Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 4 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@kkuan2011
kkuan2011 requested a review from alabiaga September 23, 2026 01:22
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.

2 participants