1. 程式人生 > >Service was originally bound here

Service was originally bound here

1.錯誤原因:

在Activity運行了bindService()開啟Service(全名:

boolean android.content.ContextWrapper.bindService(Intent service,ServiceConnection conn, int flags));但在destory()裡沒有呼叫unbindService ()關閉Service(

就會出現這種異常;
1.解決辦法,在Activity中destory()里加上unbindService(ServiceConnection conn)即可;

1.貼出我的throw Exception,僅作參考:

11-20 16:22:03.012: E/ActivityThread(6004):

android.app.ServiceConnectionLeaked:Activitycom.android.bluetooth.DeviceScanActivity has leaked [email protected]fb28 that was originally boundhere;

at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:972);

at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:866);

at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1637);

atandroid.app.ContextImpl.bindService(ContextImpl.java:1620);

at android.content.ContextWrapper.bindService(ContextWrapper.java:517);

atcom.android.bluetooth.DeviceScanActivity.addDevice (DeviceScanActivity.java:542);

at com.android.bluetooth.DeviceScanActivity$3$1.run(DeviceScanActivity.java:308);

atandroid.os.Handler.handleCallback(Handler.java:733);

atandroid.os.Handler.dispatchMessage(Handler.java:95);

at android.os.Looper.loop(Looper.java:136);

atandroid.app.ActivityThread.main(ActivityThread.java:5133);

atjava.lang.reflect.Method.invokeNative(Native Method);

atjava.lang.reflect.Method.invoke(Method.java:515);

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795);

atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:611);

at dalvik.system.NativeStart.main(NativeMethod);


相關推薦

Service was originally bound here

1.錯誤原因: 在Activity運行了bindService()開啟Service(全名: boolean android.content.ContextWrapper.bindService(Intent service,ServiceConnection conn,

service 沒有unbind時was originally bound here錯誤

 在程式中,如果在activity中綁定了服務,而沒有在destory中,寫unbind,會出現這種異常, Activity com.neusoft.dsn.infoplayer.InfoPlayerActivity has leaked ServiceConnection [email prote

Activity has leaked ServiceConnection that was originally bound here

當我們採用bindService(service, conn, flags)而不是 startService(service)啟動服務Service的時候,如果我們在關閉Activity的時候沒有釋放

關於WindowManager的一個小問題was originally added here

 WindowManager  :懸浮層   它的View顯示在整個系統的最頂層,在設定屬性後,此View則可以存在手機主視窗上 給windowManager新增overlay這個檢視 LayoutInflater inflater = LayoutInflater.

Nexus啟動失敗處理:The nexus service was launched, but failed to start.

升級了JDK為1.9後,Nexus啟動就失敗了: C:\Users\abc>nexus start wrapper  | Starting the nexus service... wrapper  | Waiting to start... wrapper  

Android-Service元件之Bound Service

bound service是工作在客戶端/服務端模式的service。bound service允許別的元件繫結到service上,然後傳送請求、接收響應、甚至是做跨程序的IPC操作。bound service只有在它為別的元件提供服務的時候才是存活的,並且不會在後臺無

nexus start的時候報 wrapper | The nexus service was launched, but failed to start

rapper  | JVM exited while loading the application. wrapper  | Reloading Wrapper configuration... wrapper  | Launching a JVM... jvm 2    | java .lang.Unsup

nexus無法啟動服務解決方法-The nexus service was launched, but failed to start.

如圖無法啟動nexus服務 首先去nexus安裝路徑下的wrapper.log檢視錯誤資訊 我的是如下錯誤: 解決方法:開啟nexus安裝路徑下的wrapper.conf檔案 然後找到 wrapper.java.command=java 這行 如

cmake window下 sh.exe was found in your PATH, here

sts then cpp rec 解決 window 系統環境 not sta 在window下 mingw環境下 用 camke 編譯Cpp程序 CMake Error at D:/Program Files/CMake/share/cmake-3.8/Modules/

service v2ray status檢視狀態 Warning: Journal has been rotated since unit was started. 問什麼有lines 1-11/

  v2ray檢視狀態命令後邊有  "lines 1-11/11 (END)"  為什麼???   為什麼檢視狀態有  Warning: Journal has been rotated since unit was

Here’s Why You’ve Been Getting So Many Privacy Policy and Terms of Service Updates Lately

Here’s Why You’ve Been Getting So Many Privacy Policy and Terms of Service Updates LatelyThank the General Data Protection Regulations (GDPR) for the recen

Started ServiceBound Service

主要說明Started Service與Bound Service的區別於聯絡。 一:基本用法 Stared Service 對於一個Component物件,呼叫startService(Intent aIntent)來啟動一個Service。 啟動

Android四大元件之Service第二章:Bound Service

這一章介紹bound service(我也不知道怎麼翻譯比較好。。)。建議先看前一章對服務有個大概的瞭解了再看bound service。 Android四大元件之Service第一章:service及其生命週期 bound service是一種採用了cli

RA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was

RA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: 192.168.1.111:1521:orcl 有時候連得上資料庫,有

Angularjs演示Service功能

lar 控制器 com 函數 splay click log ica multipl 在angularjs中,我們可以自定義自己的service。可以說得是自定義的方法,函數。下面我們一步一步來演示吧:首先為angularjs定義一個app: var demoAp

winrm service

一點 知識庫 telnet item trouble err adr 遠程管理 abc 今天看腳本忽然發現一個服務,叫winRM服務,這是個PowerShell的遠程管理。開啟它可以很大程度的方便用PowerShell操控! 下面是我找到的一些資料: 在Linux中,我們可

解決okHttp使用https拋出stream was reset: PROTOCOL_ERROR的問題

com client pan code tex toc error 實例化 http2 昨天在做Android接口調用的時候,api接口是https的,用okhttp拋出: okhttp3.internal.http2.StreamResetException: strea

symfony框架中使用service

其他 fig文件 red ont color 執行 sts chat edi 在config文件裏面的service.yml寫入自己service 1 chat.group_list: //service的名字 2 class: Chat\Service\G

here with you

vertical can more lose 音樂 and -a ember music Here With You - Asher Book To all my friends對我所有好友來講The night is young夜未央The music‘s loud樂未殤

pip install報錯Can't roll back cryptography; was not uninstalled

libffi -- not 進行 sudo 繼續 pan code ack 當使用pip install或者pip install --upgrade報錯 Can‘t roll back cryptography; was not uninstalled 可以進行以下的