摘要: 开始一个Service 你可以从一个activity或从其它应用的组件通过传递一个Intent(指定了要启动的服务)给startService()启动一个服务.Android系统然后调用service的onStartCommand()方法并且把Intent传递给它.(你永远不能直接调用onStartCommand().) 例如,一个activity可以在调用startService()时使用一个明确的intent开始前文的例子中的service(HelloSevice):Intentintent = new Intent(this, HelloService.class);startSer.. 阅读全文
posted @ 2012-03-08 07:31 移动应用开发 阅读(619) 评论(0) 推荐(0)