Questions tagged «serviceconnection»

10
活动<应用程序名称>泄漏了最初绑定在此处的ServiceConnection <ServiceConnection名称> @ 438030a8
我正在开发我的第一个Android应用程序。我的应用程序中有三个活动,用户经常来回切换。我还拥有一个处理telnet连接的远程服务。这些应用程序需要绑定到此服务才能发送/接收telnet消息。 编辑 谢谢BDLS为您提供丰富的答案。根据您对bindService()用作独立功能或after之后的区别的澄清,我已经重新编写了代码,startService()现在当使用后退按钮在活动之间循环时,我只会间歇性地收到泄漏错误消息。 我的连接活动具有以下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. */ …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.