title: Android-Sometimes app hangs with Black screen saying Channel is unrecoverably broken
body: <p>I designed an app to plot <code>LatLng</code> <code>Markers</code> on <code>Google Map V2</code>. I stored the the LatLng values in <code>SQLite Database</code>. It's all working well. But some times when I switch between other apps and resume my app the Screen appears black and back and soft key doesn't work. I have to restart in-order to open the app again.
  I monitored my phone in stacktrace but I can't understand the problem. I've posted my Stacktrace here.Please help me.</p>
  
  <p><strong>My Stack trace is</strong></p>
  
  <pre><code>10-07 11:52:20.126    1216-1316/? E/﹕ no predefined limited group find for com.realtech.latlngrecorder, add to foreground group
  10-07 11:52:20.976      933-946/? I/Timeline﹕ Timeline: Activity_windows_visible id: ActivityRecord{43296ca0 u0 com.realtech.latlngrecorder/.LocationsList t55} time:77643091
  10-07 11:52:33.376  15866-15876/? W/SQLiteConnectionPool﹕ A SQLiteConnection object for database '/data/data/com.realtech.latlngrecorder/databases/latLngDB' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
  10-07 11:52:33.376  15866-15876/? W/SQLiteConnectionPool﹕ A SQLiteConnection object for database '/data/data/com.realtech.latlngrecorder/databases/latLngDB' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
  10-07 11:54:12.986    1216-1216/? D/WhetstoneStrategy﹕ kill process in { PackageName :com.realtech.latlngrecorder Pid: 15866 Start by: activity Score:10 Old score:50 state:128 mBackgroundTimeInMillis:1444199053000 WakelockCount:0 wakelogsize:0  ActivityDestroied:false Activity size: 2 PackageInfo:{WhetstonePackageInfo#PacakgeName:com.realtech.latlngrecorderFlag:5312 [,TRIMHEAPS,SOFT_RESET,ZRAM,FLAG_DEAL_SCHEDULE] Type:0[] } tasknum:59}
  10-07 11:54:12.996     933-1491/? I/ActivityManager﹕ Killing 15866:com.realtech.latlngrecorder/u0a110 (adj 7): kill background
  10-07 11:54:13.126     933-1173/? I/WindowState﹕ WIN DEATH: Window{4279e108 u0 com.realtech.latlngrecorder/com.realtech.latlngrecorder.MainPage}
  10-07 11:54:13.146      933-977/? W/InputDispatcher﹕ channel '43aa65d0 com.realtech.latlngrecorder/com.realtech.latlngrecorder.LocationsList (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
  10-07 11:54:13.146      933-977/? E/InputDispatcher﹕ channel '43aa65d0 com.realtech.latlngrecorder/com.realtech.latlngrecorder.LocationsList (server)' ~ Channel is unrecoverably broken and will be disposed!
  10-07 11:54:13.146     933-1491/? W/InputDispatcher﹕ Attempted to unregister already unregistered input channel '43aa65d0 com.realtech.latlngrecorder/com.realtech.latlngrecorder.LocationsList (server)'
  10-07 11:54:13.146     933-1491/? I/WindowState﹕ WIN DEATH: Window{43aa65d0 u0 com.realtech.latlngrecorder/com.realtech.latlngrecorder.LocationsList}
  10-07 11:54:13.176      933-948/? W/LocationManagerService﹕ RemoteException calling onLocationChanged on Reciever[43426f90 listener UpdateRecord[gps com.realtech.latlngrecorder(10110) Request[ACCURACY_FINE gps requested=0 fastest=0]]]
  10-07 11:54:13.176      933-948/? W/LocationManagerService﹕ RemoteException calling onLocationChanged on Reciever[438453b0 listener UpdateRecord[gps com.realtech.latlngrecorder(10110) Request[ACCURACY_FINE gps requested=0 fastest=0]]]
  10-07 11:54:34.136     933-1215/? I/ActivityManager﹕ Start proc com.realtech.latlngrecorder for activity com.realtech.latlngrecorder/.LocationsList: pid=12918 uid=10110 gids={50110, 3003, 1028, 1015}
  10-07 11:54:34.296    1216-1316/? E/﹕ no predefined limited group find for com.realtech.latlngrecorder, add to foreground group
  10-07 11:54:34.446  12918-12918/? D/ActivityThread﹕ handleBindApplication:com.realtech.latlngrecorder
  10-07 11:54:35.136    1015-1015/? D/PhoneStatusBar﹕ addNotification pkg=com.realtech.latlngrecorder;basepkg=com.android.systemui;id=252119
  10-07 11:54:44.466      933-946/? E/WindowManager﹕ Starting window AppWindowToken{43695b28 token=Token{43296e00 ActivityRecord{43296ca0 u0 com.realtech.latlngrecorder/.LocationsList t55}}} timed out
  10-07 11:54:54.046      933-947/? E/ActivityManager﹕ ANR in com.realtech.latlngrecorder (com.realtech.latlngrecorder/.LocationsList)
  PID: 12918
  Reason: Input dispatching timed out (Waiting because no window has focus but there is a focused application that may eventually add a window when it finishes starting up.)
  Parent: com.ttxapps.dropsync/com.ttxapps.syncapp.MainActivity
      Load: 5.33 / 4.76 / 4.41
  CPU usage from 5618ms to 0ms ago:
  99% 12918/com.realtech.latlngrecorder: 98% user + 1% kernel / faults: 2799 minor
  1.7% 933/system_server: 0.7% user + 1% kernel / faults: 368 minor 4 major
  0.7% 12640/com.ttxapps.dropsync: 0.5% user + 0.1% kernel / faults: 17 minor
  0.3% 1015/com.android.systemui: 0.3% user + 0% kernel / faults: 5 minor
      0.3% 1175/com.google.android.gms.persistent: 0.1% user + 0.1% kernel / faults: 7 minor 1 major
  0.3% 1892/com.lbe.security.miui: 0.1% user + 0.1% kernel / faults: 6 minor 1 major
  0% 1//init: 0% user + 0% kernel / faults: 92 minor
  0.1% 132/irq/327-ft5x06_: 0% user + 0.1% kernel
  0% 138/cfinteractive: 0% user + 0% kernel
  0% 143/mmcqd/0: 0% user + 0% kernel
  0% 1133/com.xiaomi.xmsf: 0% user + 0% kernel / faults: 10 minor
  0.1% 9027/kworker/0:5: 0% user + 0.1% kernel
  0% 12423/kworker/1:4: 0% user + 0% kernel
  52% TOTAL: 50% user + 1.5% kernel + 0.1% iowait
  CPU usage from 2667ms to 3183ms later with 98% awake:
  98% 12918/com.realtech.latlngrecorder: 98% user + 0% kernel / faults: 245 minor
  100% 12918/.latlngrecorder: 100% user + 0% kernel
  3.8% 933/system_server: 1.9% user + 1.9% kernel
  3.8% 947/ActivityManager: 1.9% user + 1.9% kernel
  1.4% 12452/com.google.android.gms: 1.4% user + 0% kernel / faults: 3 minor
  1.4% 12760/Chrome_IOThread: 1.4% user + 0% kernel
  5.2% TOTAL: 0% user + 0% kernel + 5.1% iowait
  10-07 11:54:57.796      933-947/? W/ActivityManager﹕ Activity pause timeout for ActivityRecord{43296ca0 u0 com.realtech.latlngrecorder/.LocationsList t55}
  10-07 11:55:01.596    1216-1316/? E/﹕ no predefined limited group find for com.realtech.latlngrecorder, add to foreground group
  10-07 11:55:06.186      933-947/? W/ActivityManager﹕ Activity pause timeout for ActivityRecord{43296ca0 u0 com.realtech.latlngrecorder/.LocationsList t55}
  </code></pre>