6

This started to happen when I switched to 4.2 on my Galaxy Nexus and persists with my Nexus 4. My app crashes (soft reset) the device randomly, even with no user input.

Here is the Logcat right before the crash:

01-17 12:54:24.960: E/AccessibilityManager(10497): Error during sending EventType: TYPE_WINDOW_CONTENT_CHANGED; EventTime: 151405384; PackageName: com.ntasher.homeconII; MovementGranularity: 0; Action: 0 [ ClassName: android.widget.FrameLayout; Text: []; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; IsEnabled: true; IsPassword: false; IsChecked: false; IsFullScreen: false; Scrollable: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: -1; ScrollY: -1; MaxScrollX: -1; MaxScrollY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null ]; recordCount: 0 
01-17 12:54:24.960: E/AccessibilityManager(10497): android.os.DeadObjectException
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.os.BinderProxy.transact(Native Method)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.view.accessibility.IAccessibilityManager$Stub$Proxy.sendAccessibilityEvent(IAccessibilityManager.java:227)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.view.accessibility.AccessibilityManager.sendAccessibilityEvent(AccessibilityManager.java:265)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.view.ViewRootImpl.requestSendAccessibilityEvent(ViewRootImpl.java:4700)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:4699)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.view.View.sendAccessibilityEventUnchecked(View.java:4680)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.view.View.sendAccessibilityEventInternal(View.java:4657)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.view.View.sendAccessibilityEvent(View.java:4626)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at com.android.internal.policy.impl.PhoneWindow$DecorView.sendAccessibilityEvent(PhoneWindow.java:2067)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.run(ViewRootImpl.java:5462)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.os.Handler.handleCallback(Handler.java:725)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.os.Handler.dispatchMessage(Handler.java:92)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.os.Looper.loop(Looper.java:137)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at android.app.ActivityThread.main(ActivityThread.java:5039)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at java.lang.reflect.Method.invokeNative(Native Method)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at java.lang.reflect.Method.invoke(Method.java:511)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-17 12:54:24.960: E/AccessibilityManager(10497):  at dalvik.system.NativeStart.main(Native Method)
01-17 12:54:25.931: E/InputEventReceiver(10497): channel '42466698 com.ntasher.homeconII/com.ntasher.homeconII.HomeConII (client)' ~ Publisher closed input channel or an error occurred.  events=0x9

After that the device soft resets (directly to the glowing "X").

What's happening here? is it some unhandled exception? how can I catch it? Thanks.

sabadow
  • 5,095
  • 3
  • 34
  • 51
user761146
  • 111
  • 6
  • 2
    Any chance you could put the logcat in a code block? It makes it much more readable. Also, code would help! – Matt Taylor Jan 17 '13 at 11:04
  • see this question http://stackoverflow.com/questions/1573557/how-to-fix-android-os-deadobjectexception-android-x – sabadow Jan 17 '13 at 11:07

1 Answers1

2

You haven't provided any code, but I have a suspicion that this is the problem here.

You're passing an Activity Context when creating some object that's bound to the system. Due to this, when you're application is shut, and the object stays, it becomes a dead reference. A reference to an Activity which is no longer alive and visible.

In some place you're going to have lines like:

SomeClass object = new SomeClass(this); //Or getActivity() or something.

Here, change the Context parameter to getApplicationContext() (unless that code is creating and displaying a dialog, in which case let the Activity context be).

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
  • I didn't put any code since it's long and complex. I do pass on Activity (this) to a class I have written that is in another file. But if I try to call it with getApplicationContext() it will not compile and if I cast the getApplicationContext() to (Activity) it crashes when starting to run. – user761146 Jan 17 '13 at 11:55
  • Change the receiving file to Receive a Context instead of an Activity. – Raghav Sood Jan 17 '13 at 11:56