通知栏和服务连用

public class TestService extends Service {

    @Override
    public IBinder onBind(Intent intent) {
        // TODO Auto-generated method stub
        return null;
    }

    //当服务第一次开启的时候 
    @Override
    public void onCreate() {
        //确保这个服务运行在前台进程
//        startForeground(id, notification)
        
        super.onCreate();
    }
    
}

 

posted @ 2016-12-07 20:10  iFat  阅读(106)  评论(0编辑  收藏  举报