Is there any way to add a button in notification area? I want to add a button in notification area. On clicking that button a particular app will be started. So basically that button will behave like app shortcut. I have seen this answer but it didn't help.
3 Answers
You can use pendingindent for the above mentioned working, It has many optional things that can be added to your basic notification format.
Also take a look at this Notifications basic

- 407
- 6
- 14
You have to use addAction(int icon, CharSequence title, PendingIntent intent) method of the NotificationCompat.Builder
and you should specify which activity to start in your PendingIntent:
PendingIntent pendingIntent = PendingIntent.getActivity(context,
0,
new Intent(context, ActivityToStart.class),
PendingIntent.FLAG_UPDATE_CURRENT));
Also, take a look at this for basics: http://developer.android.com/training/notify-user/build-notification.html

- 140
- 6
I'm guessing you're looking for the TileService
to add a shortcut/tile in the notification panel (quick notification) area. And as most of my google searches brought me results of how to add an action to an app notification instead of this, I decided to write an answer here.
You can refer to the official reference here https://developer.android.com/reference/android/service/quicksettings/TileService .

- 729
- 9
- 23