Tag: 服务连接

活动<应用程序名称>泄露了最初在此处绑定的ServiceConnection <ServiceConnection名称> @ 438030a8

我正在开发我的第一个Android应用程序。 我在我的应用程序中有三个活动,用户频繁地来回切换。 我也有一个远程服务,它处理一个telnet连接。 应用程序需要绑定到此服务才能发送/接收telnet消息。 编辑谢谢BDLS您的丰富答案。 根据您对使用bindService()作为独立函数或在startService()之后的区别的说明,我已经重新编写了我的代码,现在我只使用后退button来间歇性地获取泄漏错误消息活动。 我的连接活动有以下onCreate()和onDestroy(): /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /* * Initialize the ServiceConnection. Note that this is the only place startService() is run. * It is also the only time bindService is run without dependency on connectStatus. */ conn = […]