- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
因此,我使用 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:
提前致谢
最佳答案
关于android - ViewPagerIndicator.CirclePageIndicator 在 OnSaveInstanceState 中崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40281748/
我正在使用 ViewPager 和 PagerAdapter 在 android 应用程序中获取 XML 的幻灯片。我正在使用 CirclePageIndicator给页面编号。如何自定义当前页面对应
如何将图像添加到圆形 pageindicator 而不是添加颜色..我尝试添加 iconpage 指示器但是点击方法不起作用但我可以添加图像..在 circlepageIndicator 中,oncl
我目前正在开发一个 Android 应用程序。当我初始化一个 UI 元素并在 fragment 中的 OnPageScrolled 中设置 UI 元素的内容时,它不仅在 fragment 中起作用,而
我正在使用来自 ViewPagerIndicator 库的 ViewPager 和 CirclePageIndicator 来显示下面带有一些圆圈的图像,但圆圈是溢出布局,像这样: 有什么方法可以定义
我将 ViewPageIndicator 添加到现有项目中。我在下面的链接中做所有事情。 https://www.youtube.com/watch?v=yTaIQ0LMLy0 当我将 CircleP
It worked before, but now it throws: android.view.InflateException: Binary XML file line #16: Binary
因此,我使用 ViewPager 和 CirclePageIndicator 进行了此 Activity 。问题是,如果我从此页面调用电话, Activity 会在 OnSaveInstanceSta
如果您在 Activity onCreate() 中有此代码: mViewPager = new ViewPager(this, null); mPagerAdapter = new PagerAda
我在查看寻呼机上有 4 页。我只想在第 1 页、第 2 页、第 3 页显示 3 个 CirclePageIndicator。第 4 页不显示 CirclePageIndicator。 mString
我正在尝试实现 TitlePageIndicator 和 CirclePageIndicator 来创建如下内容: 这是我的代码: pageAdapter = new MyPageAdapte
我正在为 Android studio 编写代码,我需要 Page Indicator 和 viewpagerindicator.CirclePageIndicator 但它们告诉我错误,所以我无法编
我在 MainActivity 中将 circlePageIndicator 与我的 Viewpager 一起使用。 circlePagerIndicator.setViewPager(mPager)
我是一名优秀的程序员,十分优秀!