解决方案 »
- 关于联系人多音字的搜索问题
- Handler 的postDelayed 这方法的作用是什么?
- 把平板最下方的那行statusbar隐藏
- android drm问题
- android串口通信
- com.android.camera.NEW_PICTURE 这个广播在哪里?
- Android开发_联系人相关
- 这种代码怎么执行到的, 看不明白的? 哪位高手解析下?
- android sqlite关于数据表的问题
- Android:怎么解析网上已知格式的json数据文件,并显示到界面上
- 菜鸟问题:上传图片哪个好用啊?“HttpPost”还是“HttpURLConnection”
- 引入了外部jar,编译能通过,但模拟器运行时报错
// 比如有个ID为bt_cancle的按钮,点击后发送一个广播,则在创建notification时参考下面的代码添加你的按钮事件
Intent cancelIntent = new Intent(NOTIFY_CANCEL);
cancelIntent.putExtra(INTENT_URL, url);
Bundle bundleCancel = new Bundle();
bundleCancel.putInt(INTENT_FLAG, notifyflag);
cancelIntent.putExtras(bundleCancel);
PendingIntent cancelPendIntent = PendingIntent.getBroadcast(this, notifyflag,
cancelIntent, 0);
mRemoteViews.setOnClickPendingIntent(R.id.bt_cancle, cancelPendIntent);
R.layout.notification_download);
原始版本Notification
3.0通过Notification.Builder 创建;
4.0通过NotificationCompat.Builder创建4.0以上版本才支持Button