我在这里找到了一些帮助,但没有什么实质性的。
我已经成功地将我的 Android 项目从 Eclipse 移动到 IntelliJ IDEA,并且正在尝试适应 UI。我已经将它设置为构建和运行,但是当我抛出异常时,我不知道如何像 Eclipse 那样查看堆栈跟踪。
例如,在 Eclipse 中运行它:
((TextView)findViewById(R.id.abs__action_bar)).setText("Temp");
在 Eclipse 的“LogCat”视图中产生以下结果:
E/AndroidRuntime(341): FATAL EXCEPTION: main
E/AndroidRuntime(341): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appname/com.appname.activity.HomeActivity}: java.lang.ClassCastException: com.actionbarsherlock.internal.widget.ActionBarView
E/AndroidRuntime(341): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
E/AndroidRuntime(341): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
E/AndroidRuntime(341): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime(341): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/AndroidRuntime(341): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(341): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(341): at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime(341): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(341): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(341): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(341): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime(341): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(341): Caused by: java.lang.ClassCastException: com.actionbarsherlock.internal.widget.ActionBarView
E/AndroidRuntime(341): at com.appname.activity.HomeActivity.init(HomeActivity.java:150)
E/AndroidRuntime(341): at com.appname.activity.HomeActivity.access$0(HomeActivity.java:127)
E/AndroidRuntime(341): at com.appname.activity.HomeActivity$1.execute(HomeActivity.java:111)
E/AndroidRuntime(341): at com.appname.helper.Security.checkCredentialsAndLogin(Security.java:139)
E/AndroidRuntime(341): at com.appname.activity.HomeActivity.onCreate(HomeActivity.java:118)
E/AndroidRuntime(341): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(341): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
E/AndroidRuntime(341): ... 11 more
而在 IntelliJ 中,当我“调试 ProjectName”时,在启用“中断所有异常”后,我得到的只是如下所示: