- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 crashlytics 中遇到了一些异常。但无法找到异常的文件或原因。另外,我每次都得到不同的行号。
我没有太多信息,我正在寻找详细信息。
我从 crashlytics 获得设备详细信息,例如:
-- 三星 SM-G950F -- Android 8 -- View.java 第 18877 行,View.java 第 18891 行
-- Oppo R7plusf -- Android 5 -- View.java 13790 行
--华硕 ASUS_X00LD -- Android 8 -- View.java 行 17753
View.java 行 18891 android.view.View.onRestoreInstanceState
Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{com.lendlease.plus/com.lendlease.plus.activity.ReceiptDetailActivity}: java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.os.Bundle instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/ivReceipt. Make sure other views do not use the same id.
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2955)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3030)
android.app.ActivityThread.-wrap11 (Unknown Source)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1696)
android.os.Handler.dispatchMessage (Handler.java:105)
android.os.Looper.loop (Looper.java:164)
android.app.ActivityThread.main (ActivityThread.java:6938)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
如果您遇到此类异常,请告诉我,或者您可能知道造成这种情况的任何原因。
谢谢!
最佳答案
你读过崩溃报告了吗
expecting View State but received class android.os.Bundle instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/ivReceipt. Make sure other views do not use the same id. android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2955)
报告说在你的 ReceiptDetailActivity
布局中你有两个不同的 View 包含相同的 id ivReceipt
根据您的以下评论
Yes in that layout there is one included layout which contains same ivReceipt id
解决方案 不要使用相同的 ID 只需更改 id 名称即可
关于android - View.java 行 18891 android.view.View.onRestoreInstanceState 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53862673/
所以我对 onSaveInstanceState 和 onRestoreInstanceState 有一个奇怪的问题。以下是我到目前为止所拥有的,并且运行良好。方法正常调用,值保存和恢复都很好。 @O
我需要你的帮助。我正在制作一个应用程序,我使用方法 onSaveInstanceState() 和 onRestoreInstanceState(),但第二种方法不起作用。 当按下主页按钮时,我可以看
继续上一个问题 第一个屏幕 Activity 我正在单击一个按钮并执行此操作 Intent intent = new Intent(MainMenu.this, NewClass.class); in
我最近在使用 onSaveInstanceState() 和 onRestoreInstanceState() 时遇到了一些麻烦。我有多个 Activity 使用这些方法来保存状态,以防它们被系统清理
这个问题在这里已经有了答案: onSaveInstanceState () and onRestoreInstanceState () (13 个答案) 关闭 9 年前。 我对 Android 中的
我已经编写了所有需要的代码来保存我的 Activity 状态(一个带有 EditText 小部件的简单表单)并在手机旋转时恢复它,而且效果很好。 我的问题是管理屏幕开/关变化:关闭时,onSaveIn
我想在 App 进入 onPause 时保存 textView 的值。所以我实现了 onSaveInstanceState 和 onRestoreInstanceState。但如下面的 logcat
对不起,我的不理解,但我是android开发的新手。 我有一个包含 Activity A 和 Activity B 的应用程序,我从 Activity A 转到 Activity B。当我离开 Act
我是否遗漏了什么或 Fragment 没有 onRestoreInstanceState() 方法?如果没有,我该如何获得类似的东西? 最佳答案 fragment 没有 onRestoreInstan
当我在 listView 中输入某些内容并旋转它后,listView 返回 null 而不是我输入的文本。您能解释一下为什么会发生这种情况吗? override fun onRestoreInstan
情况是我想创建一个应用程序,每次单击按钮时它应该能够在 LinearLayout 中创建一个新的 TextView。来自EditText的文本被分配给所述TextView。我成功地做到了这一点。然而,
我对 Android 开发和 StackOverflow 都很陌生,我希望我问的不是一个愚蠢的问题,这个问题以前有人问过,但我在上面找不到任何东西。 我正在制作一个应用程序,它在连接到蓝牙设备时启动(
如何保存/恢复附加到 CursorAdapter 的 ListView 的状态?示例: 我有一个带有 3 个 ListView 的 Android Activity:国家、地区、城市。 它们附加到 3
我在一个计数程序中遇到了一个问题,该程序显示了诸如 onCreate、onStart 等方法被调用了多少次,当我从 Activity1 转到 Activity2 然后再回到 Activity1 时它似
我正在开发一个应用程序,当您转到屏幕时,您可以从 onCreate 中创建的对话框中选择您的位置。选择位置后,它会将其写入预定义的 TextView。我遇到的一个问题是,当屏幕方向发生变化时,它会重新
下面的 SwiperActivity,从 ActionBarSherlock 4.0.2 库扩展 SherlockFragmentActivity。我只能在加载不同的应用程序负载,然后切换回来后,在
ClassCastException随机出现,用于在onRestoreInstanceState()中恢复Vector。恢复vector一般都很好完成,但有时会出现异常。 我认为当 Activity
在我的应用程序中,在正常操作期间执行 onRestoreInstanceStatance 函数并在某些监听器中导致空指针异常,而无需调用该监听器。我的应用程序包含大量数据,我在 onPause 中写入
我正在尝试弄清楚 onSaveInstanceState/onRestoreInstanceState 如何与对话框一起工作。使用 Acitivity 很容易,因为它们会在 Activity 被终止/
我正在尝试在我的 Activity 中保存数据而不是恢复它。我将数据保存在 onSaveInstanceState() 中,然后尝试恢复 onRestoreInstanceState() 中的数据。
我是一名优秀的程序员,十分优秀!