良い一日。エミュレーターでのプログラムの起動に問題があります。コードがあります:
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
プログラムは正常にビルドされましたが、その後例外が表示されます
java.lang.NullPointerException
at java.util.Arrays$ArrayList.<init>(Arrays.java:2842)
at java.util.Arrays.asList(Arrays.java:2828)
at com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings.addRecognizedFeatures(ParserConfigurationSettings.java:115)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.<init>(SAXParserImpl.java:189)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:81)
at com.android.sdklib.devices.DeviceParser.getParser(DeviceParser.java:371)
at com.android.sdklib.devices.DeviceParser.parse(DeviceParser.java:355)
at com.android.sdklib.devices.DeviceManager.loadDevices(DeviceManager.java:419)
at com.android.sdklib.devices.DeviceManager.getVendorDevices(DeviceManager.java:215)
at com.android.sdklib.devices.DeviceManager.getDevices(DeviceManager.java:167)
at com.android.sdklib.devices.DeviceManager.getDevice(DeviceManager.java:147)
at com.android.sdklib.devices.DeviceManager.getDeviceStatus(DeviceManager.java:136)
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1413)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1325)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:286)
at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:296)
at org.netbeans.modules.android.project.launch.AndroidLauncherImpl.configAvd(AndroidLauncherImpl.java:130)
at org.netbeans.modules.android.project.launch.AndroidLauncherImpl.launch(AndroidLauncherImpl.java:79)
at org.netbeans.modules.android.project.LaunchExecutor$1.taskFinished(LaunchExecutor.java:92)
at org.openide.util.Task.notifyFinished(Task.java:236)
at org.openide.util.Task.run(Task.java:256)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1452) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2032)
これで私を助けてもらえますか?ありがとう。
PS Emulator は AVD マネージャー経由で起動できますが、Netbeans 経由では起動できません。