[英]android.content.res.Resources$NotFoundException: Resource ID #0x0
[英]android.content.res.Resources$NotFoundException · String resource ID #
我收到此錯誤:
android.content.res.Resources$NotFoundException · 字符串資源 ID #0x2040003
在完整的堆棧中,我看到它取決於:
Resources.java:322android.content.res.Resources.getText
我知道錯誤可能是我在某處調用了setText
而不傳遞字符串。
我的問題是我不知道問題出在哪里。
從技術上講,錯誤行是這樣的:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_web, container, false); // <-- HERE IS THE ERROR
}
布局文件是:
<WebView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".view.WebFragment" />
我不知道如何找到發生錯誤的行代碼。
它可能與此問題有關: https ://issuetracker.google.com/issues/141132133 關於 Webview。
它也發生在我身上,就我而言,它是擴展 Webview 的 MarkdownView。 顯然升級 android appcompat 庫解決了這個問題,但我仍然希望為當前庫版本提供另一個解決方案。
因為我在 2 個不同的地方使用了導致崩潰的元素(具有相同的實現)並且它只在其中一個崩潰。 我一直在花時間搜索這個問題,但仍然不知道為什么以及如何解決它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.