/**
     * Request that a given application service be started.  The Intent
     * should contain either contain the complete class name of a specific service
     * implementation to start or a specific package name to target.  If the
     * Intent is less specified, it log a warning about this and which of the
     * multiple matching services it finds and uses will be undefined.  If this service
     * is not already running, it will be instantiated and started (creating a
     * process for it if needed); if it is running then it remains running.
     *
     *

Every call to this method will result in a corresponding call to
     * the target service's {@link android.app.Service#onStartCommand} method,
     * with the intent given here.  This provides a convenient way
     * to submit jobs to a service without having to bind and call on to its
     * interface.

     *
     *

Using startService() overrides the default service lifetime that is
     * managed by {@link #bindService}: it requires the service to remain
     * running until {@link #stopService} is called, regardless of whether
     * any clients are connected to it.  Note that calls to startService()
     * are not nesting: no matter how many times you call startService(),
     * a single call to {@link #stopService} will stop it.

     *
     *

The system attempts to keep running services around as much as
     * possible.  The only time they should be stopped is if the current
     * foreground application is using so many resources that the service needs
     * to be killed.  If any errors happen in the service's process, it will
     * automatically be restarted.
     *
     *

This function will throw {@link SecurityException} if you do not
     * have permission to start the given service.
     *
     * @param service Identifies the service to be started.  The Intent must be either
     *      fully explicit (supplying a component name) or specify a specific package
     *      name it is targetted to.  Additional values
     *      may be included in the Intent extras to supply arguments along with
     *      this specific start call.
     *
     * @return If the service is being started or is already running, the
     * {@link ComponentName} of the actual service that was started is
     * returned; else if the service does not exist null is returned.
     *
     * @throws SecurityException
     *
     * @see #stopService
     * @see #bindService
     */
    public abstract ComponentName startService(Intent service);

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. 从java内存分配角度分析android内存泄漏
  2. 【android】安卓开发学习路线图
  3. Android(安卓)传感器 都有哪些?
  4. Android中SharedPreferences的基本使用
  5. [hanchao3c]Android的MediaPlayer架构介
  6. Android官方入门文档[16]创建一个Fragmen
  7. Android(安卓)新手摸石头过河
  8. Android中的Bundle类
  9. NDK 学习 ndk基础
  10. 最近的工作记录:键盘敲入的Linux Shell命