@ Activity生命活动周期
onCreate //创建
onStart //开始
onResume // 显示,获得焦点
onPause //可见,失去焦点
onStop // 不可见
onDestroy //销毁
创建和销毁在一次生命活动中只调用一次。
Handler
Sercice的启动方式
startSercice
bindSercice
Service常用的方法
onCreate()
onStartCommand()
btnStart=(Button)findViewById(R.id.btnStart);绑定按钮
btnStart.setOnClickListener(this); 注册监听
intent = new Intent(“heying.myService”);
startService(intent);
break;