• 通知栏设置


    一般在service里设置

        

    public static NotificationManager nm;

    private String _title;
    private String _artist;


    /** * 当开始播放时,通知栏显示当前播放信息 */ private void ShowNotifcation() { nm = (NotificationManager) getApplicationContext().getSystemService( Context.NOTIFICATION_SERVICE);//获取通知栏系统服务对象 notification = new Notification();// 实例化通知栏 notification.icon = R.drawable.icon;// 为通知栏增加图标 notification.defaults = Notification.DEFAULT_LIGHTS;// 默认灯 notification.flags |= Notification.FLAG_AUTO_CANCEL;// 永远驻留 notification.when = System.currentTimeMillis();// 获得系统时间 notification.tickerText = _title; notification.tickerText = _artist; Intent intent2 = new Intent(getApplicationContext(), PlayMusicActivity.class); intent2.putExtra("_ids", _ids); intent2.putExtra("_titles", _titles); intent2.putExtra("_artists", _artists); intent2.putExtra("position", position); PendingIntent contentIntent = PendingIntent.getActivity( getApplicationContext(), 0, intent2, PendingIntent.FLAG_UPDATE_CURRENT); notification.setLatestEventInfo(getApplicationContext(), "播放中", _title, contentIntent); nm.notify(0, notification); }
  • 相关阅读:
    参考SQLHelper编写的OracleHelper
    微软原版SQLHelper类
    AppFabric 版本区分
    ASP.NET (HttpModule,HttpHandler)
    ASP.NET内部原理(HttpHandler和HttpModule)
    IIS 7.0, ASP.NET, pipelines, modules, handlers, and preconditions
    理解I/O Completion Port
    asp.net mvc跨域filter
    c#生成MD5字符串
    生成格式化的json
  • 原文地址:https://www.cnblogs.com/ct732003684/p/2851425.html
Copyright © 2020-2023  润新知