Notifications Tutorial Part 2 - ACTION BUTTONS & COLOR - Android Studio Tutorial

Veröffentlicht am: 13 Mai 2018
auf dem Kanal: Coding in Flow
102,160
1.2k

In part 2 of the notification tutorial, we will add a tap action to our notification that will open an activity, and we will add an action button that will trigger a BroadcastReceiver to execute some code in it's onReceive method.
In both cases we have to create an Intent and wrap it into a PendingIntent, which we pass to our NotificationCompat.Builder. We define the tap action with setContentIntent and add our action buttons with addAction.
Also we will change the color of our notification content with setColor and specify it's behavior with setAutoCancel and setOnlyAlertOnce.

Documentation about back stack & navigation:
https://developer.android.com/trainin...
https://developer.android.com/guide/c...

Watch the whole playlist:
   • Playlist  

Example code for this part:
https://gist.github.com/codinginflow/...

____________________
💻 Find the BEST programming tutorials on TutHub:
https://tuthub.io

⭐ Get my MVVM Caching Course now:
https://codinginflow.com/caching

❗ Subscribe to the channel:
   / codinginflo.  .

📨 Subscribe to the Coding in Flow newsletter:
https://codinginflow.com/newsletter

❓ Join our free developer community:
  / discord  

📣 Follow Coding in Flow on other sites:
Facebook:   / codinginflow  
Instagram:   / codinginflow  
TikTok:   / codinginflow  
Twitter:   / codinginflow  
Github: https://github.com/codinginflow

💰 Business requests, sponsoring, etc.: info@codinginflow.com


Auf dieser Seite können Sie das Online-Video Notifications Tutorial Part 2 - ACTION BUTTONS & COLOR - Android Studio Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Coding in Flow 13 Mai 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 102,160 Mal angesehen und es wurde von 1.2 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!