The customer reports: We are experiencing production crashes in our app while using the 1.3 version of the MuPDF library. The exception stack trace is: 20140326 110428 PDT:HockeyExceptionHandler:uncaughtException:Received uncaught exception. java.lang.UnsupportedOperationException: Not supported at com.artifex.mupdfdemo.ReaderView.getSelectedView(ReaderView.java:660) at android.widget.AdapterView.onInitializeAccessibilityEvent(AdapterView.java:951) at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:4946) at android.view.View.sendAccessibilityEventUnchecked(View.java:4933) at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.run(ViewRootImpl.java:6675) at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.runOrPost(ViewRootImpl.java:6701) This does appear to happen quite frequently on a Nexus 5 we have in house, but for all other cases we've experienced the crash, we can't reproduce it. The code from the stack trace for getSelectedView() is the following. Do you know why Android seems to call this method, thus causing the UnsupportedOperationException? ReaderView.java: @Override public View getSelectedView() { throw new UnsupportedOperationException(getContext().getString(R.string.not_supported)); }
Bug fixed: just comment this line and return null @Override public View getSelectedView() { //throw new UnsupportedOperationException(getContext().getString(R.string.not_supported)); return null; } newscope GmbH
This is easy to reproduce if you enable 'Talkback' in the accessiblity settings. The fix should be pretty straightforward.
Actually, cs@newscope.com has supplied the fix, thanks!
commit 38402bcf8dfea7b08cb5b3e6948af078d0b3874b Author: Matt Holgate <matt@emobix.co.uk> Date: Wed Jun 18 12:21:05 2014 +0100 Fix bug #695132: MuPDF Library throwing sporadic exception on Android Android sometimes calls the 'getSelectedView()' method of an AdapterView. This can be made to happen more predicatably by enabling the Talkback accessibility feature. Remove the UnsupportedOperationException and just return null, as we the ReaderView does not have the concept of a selected page.