Android中Service学习(二)

来源:互联网 发布:中国数据安全法 编辑:程序博客网 时间:2024/05/29 15:31

复习:
   Service
      服务
   1。继承 Service
   2. 项目描述文件注册
        <service android:name="xxx">
         <intent-filter>
            <action name="com.myserver"/>
         </intent-filter>
        </service>
  3.启动服务
    Intent it=new Intent(context,XXX.class);
    Intent it=new Intent("com.myserver");
    startService(it)

    stopService(it)

    bindservice
    unbindService
/////////////////////////////////////////////////////////
    (xxxxManager)getSystemService(xxxx);

原创粉丝点击