Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old August 31st, 2012, 10:38 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jun 2012
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Laugh pause/play button on notification

hey guys
i want to write a code in which notification having one button (pause) and when user press it pause the media play..
here is my notification code
please suggest me solution or any sample code for this


int icon = R.drawable.vmix;
CharSequence tickerText = "Vmix";
long when = System.currentTimeMillis();

Notification notification = new Notification(icon, tickerText, when);

notification.flags |= Notification.FLAG_ONGOING_EVENT;


String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);

RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.noti);
contentView.setImageViewResource(R.id.image, R.drawable.vmix);


notification.contentView = contentView;

Intent notificationIntent = new Intent(this, MainActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

notification.contentIntent = contentIntent;
final int CUSTOM_VIEW_ID = 1;
mNotificationManager.notify(CUSTOM_VIEW_ID, notification);

swapniladsure is offline  
Reply With Quote
sponsored links
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:47 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.