【问题标题】:MUPDF UnsupportedOperationException when open the pdf打开pdf时MUPDF UnsupportedOperationException
【发布时间】:2014-02-06 11:59:01
【问题描述】:

我正在将 MUPDF 用于 android 项目,但一些 android 用户存在问题。我得到的报告如下:

 java.lang.UnsupportedOperationException: Not supported
 E/AndroidRuntime( 4677):   at com.odilogy.mupdf.ReaderView.getSelectedView(ReaderView.java:664)
 E/AndroidRuntime( 4677):   at android.widget.AdapterView.onInitializeAccessibilityEvent(AdapterView.java:951)
 E/AndroidRuntime( 4677):   at android.widget.AdapterView.onRequestSendAccessibilityEvent(AdapterView.java:926)
 E/AndroidRuntime( 4677):   at android.view.ViewGroup.requestSendAccessibilityEvent(ViewGroup.java:704)
 E/AndroidRuntime( 4677):   at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:4952)
 E/AndroidRuntime( 4677):   at android.view.View.sendAccessibilityEventUnchecked(View.java:4933)
 E/AndroidRuntime( 4677):   at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.run(ViewRootImpl.java:6675)
 E/AndroidRuntime( 4677):   at android.os.Handler.handleCallback(Handler.java:733)
 E/AndroidRuntime( 4677):   at android.os.Handler.dispatchMessage(Handler.java:95)
 E/AndroidRuntime( 4677):   at android.os.Looper.loop(Looper.java:136)
 E/AndroidRuntime( 4677):   at android.app.ActivityThread.main(ActivityThread.java:5017)
 E/AndroidRuntime( 4677):   at java.lang.reflect.Method.invokeNative(Native Method)
 E/AndroidRuntime( 4677):   at java.lang.reflect.Method.invoke(Method.java:515)
 E/AndroidRuntime( 4677):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/AndroidRuntime( 4677):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/AndroidRuntime( 4677):   at dalvik.system.NativeStart.main(Native Method)

此异常发生在这一行:

public View getSelectedView() {
    throw new UnsupportedOperationException("Not supported");
}

我不知道如何解决这个问题,有人可以帮忙吗?谢谢!

问候

【问题讨论】:

  • 你应该调查为什么这个方法 getSelectedView() 被执行。如果只是不想抛出异常,可以注释掉 //throw new UnsupportedOperationException("Not supported");

标签: java android exception mupdf


【解决方案1】:

刚刚修复:

public View getSelectedView() {
//throw new UnsupportedOperationException("Not supported");

return null;

【讨论】:

  • 这是修补症状,而不是解决问题。
  • 其实是MuPDF team给出的解决方案
  • 我只在新的 Android 版本(例如 7.0)中收到此错误。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-02-05
  • 2014-04-28
  • 2015-07-20
  • 2023-03-23
  • 2012-08-09
  • 2020-01-21
  • 2016-03-11
相关资源
最近更新 更多