工作线程中的所有方法 运行?

All methods run in worker thread?

如果我创建一个 class 子 class 包含 IntentService 并实现 LocationListener,此 class 的所有方法将 运行 在工作线程中?或者只有工作线程中的 onHandleIntent() 方法 运行s?

方法所在位置的定义 运行 是由它被调用的位置定义的,而不是来自 class 它被定义的地方。

onHandleIntent 方法是在 WorkerThread 中调用的,因此如果您从 onHandleIntent 中调用任何方法,它将 运行 在 WorkerThread 中。

如果您直接在 UI 线程中从服务调用任何方法,该方法将 运行 在 UI 线程中。