XML呈现期间的异常

时间:2014-07-29 19:26:01

标签: android xml exception

渲染期间引发异常:索引:0,大小:0

在Window>中记录异常详细信息显示视图>错误日志

我不知道如何查看错误日志,无法找到它。我确定错误出现在Spinner中:

<Spinner
    android:id="@+id/spinnerRacaAnimaisAddEdit"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="15dp"
    android:background="@drawable/selector_slim_spinner"
    android:prompt="@string/escolher_raca_prompt"
    android:spinnerMode="dialog" />

我使用API​​ 11分钟和最大值19,旋转器的背景是.9,我将.9文件放在所有可绘制的文件夹中,各自的大小。我用一个网站来转换.9的大小。我不知道出了什么问题。

编辑:

我在帮助&gt;中找到错误日志关于&gt;安装细节&gt;标签配置&gt;查看错误日志

就是这样:

!MESSAGE activity_atendimento_add_edit.xml: Index: 0, Size: 0
!STACK 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(Unknown Source)
    at java.util.ArrayList.get(Unknown Source)
    at com.android.ninepatch.NinePatchChunk.draw(NinePatchChunk.java:157)
    at com.android.ninepatch.NinePatchChunk.draw(NinePatchChunk.java:101)
    at android.graphics.NinePatch_Delegate$1.draw(NinePatch_Delegate.java:242)
    at com.android.layoutlib.bridge.impl.GcSnapshot.drawInLayer(GcSnapshot.java:613)
    at com.android.layoutlib.bridge.impl.GcSnapshot.draw(GcSnapshot.java:583)
    at android.graphics.NinePatch_Delegate.draw(NinePatch_Delegate.java:239)
    at android.graphics.NinePatch_Delegate.nativeDraw(NinePatch_Delegate.java:187)
    at android.graphics.NinePatch.nativeDraw(NinePatch.java)
    at android.graphics.NinePatch.drawSoftware(NinePatch.java:172)
    at android.graphics.Canvas.drawPatch(Canvas.java:1103)
    at android.graphics.NinePatch.draw(NinePatch.java:163)
    at android.graphics.drawable.NinePatchDrawable.draw(NinePatchDrawable.java:229)
    at android.graphics.drawable.DrawableContainer.draw(DrawableContainer.java:70)
    at android.view.View.draw(View.java:14450)
    at android.view.View.draw(View.java:14350)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
    at android.view.View.draw(View.java:14468)
    at android.view.View.draw(View.java:14350)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
    at android.view.View.draw(View.java:14348)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
    at android.view.View.draw(View.java:14574)
    at android.widget.FrameLayout.draw(FrameLayout.java:472)
    at android.widget.ScrollView.draw(ScrollView.java:1603)
    at android.view.View.draw(View.java:14350)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
    at android.view.View.draw(View.java:14468)
    at android.view.View.draw(View.java:14350)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
    at android.view.View.draw(View.java:14348)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
    at android.view.View.draw(View.java:14468)
    at android.view.View.draw(View.java:14350)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
    at android.view.View.draw(View.java:14468)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:584)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:338)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:332)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderService.createRenderSession(RenderService.java:517)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(GraphicalEditorPart.java:1584)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(GraphicalEditorPart.java:1309)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.PreviewIconFactory.render(PreviewIconFactory.java:368)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.PreviewIconFactory.initColors(PreviewIconFactory.java:595)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.PreviewIconFactory.getBackgroundColor(PreviewIconFactory.java:570)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.PaletteControl.reloadPalette(PaletteControl.java:437)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.reloadPalette(GraphicalEditorPart.java:1327)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.changed(GraphicalEditorPart.java:771)
    at com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationChooser.onDeviceChange(ConfigurationChooser.java:1411)
    at com.android.ide.eclipse.adt.internal.editors.layout.configuration.DeviceMenuListener.widgetSelected(DeviceMenuListener.java:67)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

如何解决它,以便我可以在Eclipse中使用我的图形布局而没有任何问题?我的应用程序中的每个Spinner都会导致这个,但不是带有array_string的。

1 个答案:

答案 0 :(得分:1)

问题在于我在我的微调器中使用的.9图像。我将所有这些文件放在drawable-SOMETHINGdpi文件夹中,但那是错误的,所以我将.9图像放在drawable默认文件夹中,现在一切正常。