2个回答
2013-12-13
展开全部
谢谢回答,我要的效果是通知栏的多个按钮分别可以点击,类似于4.0的通知栏上的WIFI,GPS,BULETOOTH开关一样
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-12-13
展开全部
public void notification() { manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new Notification(R.drawable.icon, "MTV", System.currentTimeMillis()); // 设置MTV通知图标 RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.notification); remoteViews.setImageViewResource(R.id.image, R.drawable.icon); String singername = ""; String songname = ""; List songs = mDBManager.queryMusic("song_path like '%" + playintPath() + "%'"); try { singername = songs.get(0).artist; songname = songs.get(0).name; } catch (Exception e) { } remoteViews.setTextViewText(R.id.text, singername); remoteViews.setTextViewText(R.id.text1, songname); notification.contentView = remoteViews; Intent intent = new Intent(getApplicationContext(), PveMTVActivity.class); notification.contentIntent = PendingIntent.getActivity( getApplicationContext(), 0, intent, 0); }
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询