为什么我的进程总是显示在 DDMS 进程列表中?

发布于 2025-01-01 05:14:30 字数 363 浏览 2 评论 0原文

使用 DDMS,我看到 Android 中有 3 个活动进程:Viber、logitech Harmony 和一个带有我的包名称的进程。 问题是我从未创建过任何流程。

为什么 Android 代表我打开一个进程?出于什么目的?

另外,为什么我看不到所有其他应用程序的进程,例如 gmail、地图等,即使它们位于前台?

一些想法:我确实使用 FileObserver 监听文件夹更改。也许就是这样?也许这与在开发环境中运行应用程序有关?

Using DDMS, I see 3 processes active in my Android: Viber, logitech harmony and a process with my package name.
The thing is that I never created any process.

Why have Android opened a process on my behalf? For what purpose?

Also, why can't I see all the other apps' processes, like gmail, maps, etc. even when they are found in the foreground?

Some thoughts: I do listen to folder changes using a FileObserver. Perhaps that's the thing? Perhaps it's something related to running the app in a development environment?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

假装不在乎 2025-01-08 05:14:30

为什么 Android 会代表我打开一个进程?出于什么目的?

因为你运行了你的应用程序。

此外,为什么我看不到所有其他应用程序的进程,例如 gmail、地图等,即使它们位于前台?

因为它们不是在调试模式下编译的。在生产设备上,只有调试版本(或清单中 android:debuggable 设置为 true 的应用)才会出现在 DDMS 中。

Why have Android opened a process on my behalf? For what purpose?

Because you ran your application.

Also, why can't I see all the other apps' processes, like gmail, maps, etc. even when they are found in the foreground?

Because they are not compiled in debug mode. On a production device, only debug builds (or apps with android:debuggable set to true in the manifest) will appear in DDMS.

我很OK 2025-01-08 05:14:30

每个应用程序都在单独的进程中启动。因此,您的应用程序被显示为一个进程。也许其他应用程序在您的手机上未激活,因此不会显示。

Each app is launched in a separate process. Hence your app is being shown as a process. Perhaps other apps are not active on your phone hence they are not being shown.

揽清风入怀 2025-01-08 05:14:30

除非手机内存不足,否则 Android 会保持进程处于活动状态以防万一。当您关闭活动时,进程会保留。

那,或者你可能正在运行一个服务。当您的应用程序中运行服务时,Android 会更加尊重该进程,这意味着只有在所有不执行任何操作的进程都关闭后,它才会关闭。

Unless the phone is starved for memory, Android keeps processes alive just in case. When you close an activity, the process stays.

That, or you might have a service running. When a service is running in your app, Android treats the process with even more respect, meaning it gets shut down only after all the do-nothing processes are shut down.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文