NullPointException of AutoCompleteTextView

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

NullPointException of AutoCompleteTextView

Postby today913 » Wed Jun 10, 2009 10:07 am

This layout xml file contains an AutoCompleteTextView:
http://code.google.com/p/zz-doctor/sour ... elcome.xml
does not show in 1.5 AVD. No error in either screen or console log.

It worked fine in 1.1, in both AVD and eclipse visual layout.

When try to open it in eclipse visual layout under android 1.5, shows
NullPointException, and following stack trace in console log:
java.lang.NullPointerException
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:
458)
at android.widget.AutoCompleteTextView.<init>
(AutoCompleteTextView.java:165)
at android.widget.AutoCompleteTextView.<init>
(AutoCompleteTextView.java:131)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at android.view.LayoutInflater.createView(LayoutInflater.java:499)
at android.view.BridgeInflater.onCreateView(BridgeInflater.java:77)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:
562)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:
122)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:296)
at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:371)
at
com.android.ide.eclipse.editors.layout.GraphicalLayoutEditor.computeLayout
(Unknown Source)
at
com.android.ide.eclipse.editors.layout.GraphicalLayoutEditor.recomputeLayout
(Unknown Source)
at
com.android.ide.eclipse.editors.layout.GraphicalLayoutEditor.activated
(Unknown Source)
at com.android.ide.eclipse.editors.layout.LayoutEditor.pageChange
(Unknown Source)
at org.eclipse.ui.part.MultiPageEditorPart.setActivePage
(MultiPageEditorPart.java:973)
at org.eclipse.ui.forms.editor.FormEditor.setActivePage
(FormEditor.java:627)
at com.android.ide.eclipse.editors.AndroidEditor.selectDefaultPage
(Unknown Source)
at com.android.ide.eclipse.editors.AndroidEditor.addPages(Unknown
Source)
at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:
146)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl
(MultiPageEditorPart.java:310)
at org.eclipse.ui.internal.EditorReference.createPartHelper
(EditorReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart
(EditorReference.java:428)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart
(WorkbenchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:306)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible
(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select
(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select
(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart
(TabbedStackPresentation.java:473)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection
(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:
1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1608)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
at org.eclipse.ui.internal.EditorSashContainer.addEditor
(EditorSashContainer.java:63)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout
(EditorAreaHelper.java:217)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor
(EditorAreaHelper.java:207)
at org.eclipse.ui.internal.EditorManager.createEditorTab
(EditorManager.java:779)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor
(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor
(EditorManager.java:639)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched
(WorkbenchPage.java:2817)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor
(WorkbenchPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:
2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:
2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:
70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2668)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2652)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor
(EditorUtility.java:318)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor
(EditorUtility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:207)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun
(SelectionDispatchAction.java:274)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run
(SelectionDispatchAction.java:250)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen
(PackageExplorerActionGroup.java:363)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$5.open
(PackageExplorerPart.java:603)
at org.eclipse.jface.viewers.StructuredViewer$2.run
(StructuredViewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen
(StructuredViewer.java:818)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen
(StructuredViewer.java:1079)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen
(StructuredViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent
(OpenStrategy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:
257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent
(OpenStrategy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:
2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at org.eclipse.core.databinding.observable.Realm.runWithDefault
(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:
149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start
(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run
(EclipseAppHandle.java:193)
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:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)


When comment out AutoCompleteTextView part, it shows successfully in
eclipse visual layout under Android 1.5.

Tried simplify the AutoCompleteTextView part as
<AutoCompleteTextView />
or
<AutoCompleteTextView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
But same problem.

Tried both Windows version and Linux version, same problem. (WindowsXP
Prof SP2 and Ubuntu 9.0.4 inside VMware on Dell Latitude D630, Ubuntu
8.0.4 on Dell Insprion 600m, the two machines I have). Above error log
come from Windows.

Tried both 1.5-r1 and 1.5-r2, same problem.

Eclipse version: 3.4.2

The whole code base is compilable under 1.5, and can be retrieved
from: http://zz-doctor.googlecode.com/svn/trunk/ZZ

Please help. Thanks in advance.
today913
Freshman
Freshman
 
Posts: 5
Joined: Sun May 31, 2009 4:25 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests