gpt4 book ai didi

android - ViewPagerIndicator.CirclePageIndicator 在 OnSaveInstanceState 中崩溃

转载 作者:行者123 更新时间:2023-11-30 00:55:12 26 4
gpt4 key购买 nike

因此,我使用 ViewPager 和 CirclePageIndicator 进行了此 Activity 。问题是,如果我从此页面调用电话, Activity 会在 OnSaveInstanceState 中崩溃。

日志包含以下消息:System.MethodAccessException:方法“(wrapper dynamic-method) object:dynamic_callback_0 (intptr,intptr)”无法从方法“ViewPagerIndicator.CirclePageIndicator/SavedState:InitializeCreator ()”访问

页面很简单:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
(...)
<android.support.v4.view.ViewPager
android:id="@+id/advicesViewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/transparent" />
<viewpagerindicator.CirclePageIndicator
android:layout_width="match_parent"
android:layout_weight="0"
android:layout_height="20dp"
android:id="@+id/pageIndicator"
android:layout_gravity="bottom"
android:layout_marginBottom="5dip"
android:background="@android:color/transparent" />
</LinearLayout>

现在我没有在 OnSaveInstanceState 中做任何具体的事情:

protected override void OnSaveInstanceState(Bundle outState) {
base.OnSaveInstanceState(outState);
}

有人有想法吗?它是 ViewPager 中的错误吗?这是更完整的崩溃日志:

10-27 11:27:39.397: I/MonoDroid(21152): UNHANDLED EXCEPTION:
10-27 11:27:39.412: I/MonoDroid(21152): System.MethodAccessException: Method `(wrapper dynamic-method) object:dynamic_callback_0 (intptr,intptr)' is inaccessible from method `ViewPagerIndicator.CirclePageIndicator/SavedState:InitializeCreator ()'
10-27 11:27:39.412: I/MonoDroid(21152): at (wrapper managed-to-native) Java.Interop.NativeMethods:java_interop_jnienv_alloc_object (intptr,intptr&,intptr)
10-27 11:27:39.412: I/MonoDroid(21152): at Java.Interop.JniEnvironment+Object.AllocObject (Java.Interop.JniObjectReference type) [0x0002b] in <6404a45abb2c4b308b3171b7d4654a9c>:0
10-27 11:27:39.412: I/MonoDroid(21152): at Java.Interop.JniType.AllocObject () [0x0000d] in <6404a45abb2c4b308b3171b7d4654a9c>:0
10-27 11:27:39.412: I/MonoDroid(21152): at Java.Interop.JniPeerMembers+JniInstanceMethods.StartCreateInstance (System.String constructorSignature, System.Type declaringType, Java.Interop.JniArgumentValue* parameters) [0x0004e] in <6404a45abb2c4b308b3171b7d4654a9c>:0
10-27 11:27:39.412: I/MonoDroid(21152): at Android.Views.View+BaseSavedState..ctor (Android.OS.IParcelable superState) [0x00068] in <b89cc247a96c4a08b3f4d799211a17e9>:0
10-27 11:27:39.412: I/MonoDroid(21152): at ViewPagerIndicator.CirclePageIndicator+SavedState..ctor (Android.OS.IParcelable superState) [0x00000] in <6082434bddad42ed98ca380b4342ff37>:0
10-27 11:27:39.412: I/MonoDroid(21152): at ViewPagerIndicator.CirclePageIndicator.OnSaveInstanceState () [0x00006] in <6082434bddad42ed98ca380b4342ff37>:0
10-27 11:27:39.413: I/MonoDroid(21152): at Android.Views.View.n_OnSaveInstanceState (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <b89cc247a96c4a08b3f4d799211a17e9>:0
10-27 11:27:39.413: I/MonoDroid(21152): at (wrapper dynamic-method) System.Object:79b91d2d-6d99-430c-aadf-8224184bf0d3 (intptr,intptr)
10-27 11:27:39.635: W/google-breakpad(21152): ### ### ### ### ### ### ### ### ### ### ### ### ###
10-27 11:27:39.636: W/google-breakpad(21152): Chrome build fingerprint:
10-27 11:27:39.636: W/google-breakpad(21152): 1.0
10-27 11:27:39.636: W/google-breakpad(21152): 1
10-27 11:27:39.636: W/google-breakpad(21152): ### ### ### ### ### ### ### ### ### ### ### ### ###
10-27 11:27:39.636: E/mono-rt(21152): Stacktrace:
10-27 11:27:39.636: E/mono-rt(21152): at <unknown> <0xffffffff>
10-27 11:27:39.636: E/mono-rt(21152): at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_find_class (intptr,intptr&,string) <0x00043>
10-27 11:27:39.636: E/mono-rt(21152): at Java.Interop.JniEnvironment/Types.FindClass (string) <0x000a7>
10-27 11:27:39.636: E/mono-rt(21152): at Java.Interop.JniType..ctor (string) <0x0002b>
10-27 11:27:39.636: E/mono-rt(21152): at Java.Interop.JniPeerMembers/JniInstanceMethods..ctor (System.Type) <0x000eb>
10-27 11:27:39.636: E/mono-rt(21152): at Java.Interop.JniPeerMembers/JniInstanceMethods.GetConstructorsForType (System.Type) <0x00097>
10-27 11:27:39.636: E/mono-rt(21152): at Java.Interop.JniPeerMembers/JniInstanceMethods.StartCreateInstance (string,System.Type,Java.Interop.JniArgumentValue*) <0x0009b>
10-27 11:27:39.636: E/mono-rt(21152): at Java.Lang.Throwable..ctor (string) <0x0016b>
10-27 11:27:39.637: E/mono-rt(21152): at Android.Runtime.JavaProxyThrowable..ctor (System.Exception) <0x0001f>
10-27 11:27:39.637: E/mono-rt(21152): at Java.Lang.Throwable.FromException (System.Exception) <0x0009f>
10-27 11:27:39.637: E/mono-rt(21152): at Android.Runtime.AndroidEnvironment.UnhandledException (System.Exception) <0x00177>
10-27 11:27:39.637: E/mono-rt(21152): at (wrapper dynamic-method) object.79b91d2d-6d99-430c-aadf-8224184bf0d3 (intptr,intptr) <0x00063>
10-27 11:27:39.637: E/mono-rt(21152): at (wrapper native-to-managed) object.79b91d2d-6d99-430c-aadf-8224184bf0d3 (intptr,intptr) <0x000b3>
10-27 11:27:39.637: E/mono-rt(21152): at <unknown> <0xffffffff>
10-27 11:27:39.637: E/mono-rt(21152): at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a (intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue*) <0x00057>
10-27 11:27:39.637: E/mono-rt(21152): at Java.Interop.JniEnvironment/InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference,Java.Interop.JniObjectReference,Java.Interop.JniMethodInfo,Java.Interop.JniArgumentValue*) <0x000ab>
10-27 11:27:39.637: E/mono-rt(21152): at Java.Interop.JniPeerMembers/JniInstanceMethods.InvokeVirtualVoidMethod (string,Java.Interop.IJavaPeerable,Java.Interop.JniArgumentValue*) <0x00133>
10-27 11:27:39.637: E/mono-rt(21152): at Android.App.Activity.OnSaveInstanceState (Android.OS.Bundle) <0x0014b>
10-27 11:27:39.637: E/mono-rt(21152): at WheezMe.Droid.WheezHelpAdvicesActivity.OnSaveInstanceState (Android.OS.Bundle) <0x0001b>
10-27 11:27:39.637: E/mono-rt(21152): at Android.App.Activity.n_OnSaveInstanceState_Landroid_os_Bundle_ (intptr,intptr,intptr) <0x0005b>
10-27 11:27:39.637: E/mono-rt(21152): at (wrapper dynamic-method) object.de7a5f24-dc6e-4938-89c6-95b6aa716a51 (intptr,intptr,intptr) <0x00043>
10-27 11:27:39.637: E/mono-rt(21152): at (wrapper native-to-managed) object.de7a5f24-dc6e-4938-89c6-95b6aa716a51 (intptr,intptr,intptr) <0x000b3>
10-27 11:27:39.637: E/mono-rt(21152): Attempting native Android stacktrace:

提前致谢

最佳答案

似乎是 CirclePageIndicator 中的错误。可能链接到 this one .如果我设置

pageIndicator.SaveEnabled = false; 

然后崩溃就不会再发生了

关于android - ViewPagerIndicator.CirclePageIndicator 在 OnSaveInstanceState 中崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40281748/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com