我是编程新手。请多多包涵。我尝试使用其他视图在现有活动上开发微调器类。但是由于某些错误,执行失败。我在
中删除了与spinner类相关的所有内容以及与微调器视图相关的所有其他细节
现在,当我尝试使用现有视图执行活动时,我收到以下错误。仍然没有得到发生的事情的暗示以及如何解决这个问题
所以这里是logcat显示的内容
02-14 04:41:29.341 20105-20105/com.example.bharathduraiswamy.comboedittext E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.bharathduraiswamy.comboedittext/com.example.bharathduraiswamy.comboedittext.MainActivity}: java.lang.InstantiationException: can't instantiate class com.example.bharathduraiswamy.comboedittext.MainActivity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2239)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365)
at android.app.ActivityThread.access$600(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5336)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.InstantiationException: can't instantiate class com.example.bharathduraiswamy.comboedittext.MainActivity
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365)
at android.app.ActivityThread.access$600(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5336)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:0)
您的活动缺少默认(没有参数)构造函数或在构造函数中抛出一些异常。
答案 1 :(得分:0)
我相信抽象是在尝试实现onItemSelectListener()时创建的,但在删除与微调器视图相关的所有内容时我无法删除它
此致