应用程序意外停止,

时间:2013-03-17 22:22:07

标签: android tabs logcat android-logcat android-tabs

我不知道如何整理日志猫,所以一点点的帮助将不胜感激。在我的应用程序中,我添加了Android.Manifest中的所有类。我的代码中没有错误,但是当我在模拟器上运行应用程序时,弹出一个对话框,说“应用程序已意外停止”可能是什么问题?

03-18 01:01:04.362: D/AndroidRuntime(271): Shutting down VM
03-18 01:01:04.362: W/dalvikvm(271): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-18 01:01:04.382: E/AndroidRuntime(271): FATAL EXCEPTION: main
03-18 01:01:04.382: E/AndroidRuntime(271): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.gormahia/com.example.gormahia.TabMain}: java.lang.IllegalArgumentException: you must specify a way to create the tab content
03-18 01:01:04.382: E/AndroidRuntime(271):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
03-18 01:01:04.382: E/AndroidRuntime(271):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-18 01:01:04.382: E/AndroidRuntime(271):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-18 01:01:04.382: E/AndroidRuntime(271):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-18 01:01:04.382: E/AndroidRuntime(271):  at android.os.Handler.dispatchMessage(Handler.java:99)
03-18 01:01:04.382: E/AndroidRuntime(271):  at android.os.Looper.loop(Looper.java:123)
03-18 01:01:04.382: E/AndroidRuntime(271):  at android.app.ActivityThread.main(ActivityThread.java:4627)
03-18 01:01:04.382: E/AndroidRuntime(271):  at java.lang.reflect.Method.invokeNative(Native Method)
03-18 01:01:04.382: E/AndroidRuntime(271):  at java.lang.reflect.Method.invoke(Method.java:521)
03-18 01:01:04.382: E/AndroidRuntime(271):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-18 01:01:04.382: E/AndroidRuntime(271):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-18 01:01:04.382: E/AndroidRuntime(271):  at dalvik.system.NativeStart.main(Native Method)
03-18 01:01:04.382: E/AndroidRuntime(271): Caused by: java.lang.IllegalArgumentException: you must specify a way to create the tab content
03-18 01:01:04.382: E/AndroidRuntime(271):  at android.widget.TabHost.addTab(TabHost.java:199)
03-18 01:01:04.382: E/AndroidRuntime(271):  at com.example.gormahia.TabMain.onCreate(TabMain.java:44)
03-18 01:01:04.382: E/AndroidRuntime(271):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-18 01:01:04.382: E/AndroidRuntime(271):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-18 01:01:04.382: E/AndroidRuntime(271):  ... 11 more
03-18 01:06:04.472: I/Process(271): Sending signal. PID: 271 SIG: 9

1 个答案:

答案 0 :(得分:1)

此行提供有关问题"you must specify a way to create the tab content"

的信息
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.gormahia/com.example.gormahia.TabMain}: java.lang.IllegalArgumentException: you must specify a way to create the tab content
03-18 01:01:04.382: E/AndroidRuntime(271): 

com.example.gormahia.TabMain:第44行

 at com.example.gormahia.TabMain.onCreate(TabMain.java:44)