为什么我不能在Android SDK中设置断点?

为什么我不能在Android SDK中设置断点?,android,Android,我试图通过将断点放在 onCreate 在Activity.java内部,但它从未在该点中断。这是允许的还是可能的 这里是我的断点 protected void onCreate(Bundle savedInstanceState) { if (DEBUG_LIFECYCLE) Slog.v(TAG, "onCreate " + this + ": " + savedInstanceState); if (mLastNonConfigurationInst

我试图通过将断点放在

onCreate
在Activity.java内部,但它从未在该点中断。这是允许的还是可能的

这里是我的断点

   protected void onCreate(Bundle savedInstanceState) {
        if (DEBUG_LIFECYCLE) Slog.v(TAG, "onCreate " + this + ": " + savedInstanceState);
        if (mLastNonConfigurationInstances != null) {
            mAllLoaderManagers = mLastNonConfigurationInstances.loaders;
        }
 --breakpoint here--->>>>>>>>          if (mActivityInfo.parentActivityName != null) {
            if (mActionBar == null) {
                mEnableDefaultActionBarUp = true;
            } else {
                mActionBar.setDefaultDisplayHomeAsUpEnabled(true);
            }
        }
        if (savedInstanceState != null) {
            Parcelable p = savedInstanceState.getParcelable(FRAGMENTS_TAG);
            mFragments.restoreAllState(p, mLastNonConfigurationInstances != null
                    ? mLastNonConfigurationInstances.fragments : null);
        }
        mFragments.dispatchCreate();
        getApplication().dispatchActivityCreated(this, savedInstanceState);
        mCalled = true;
    }

我试图在super.onCreate()上进行破坏,但当我介入时,它只会在内部的所有内容上进行破坏。

不,您不能将其放在方法声明语句中(我认为这是正确的,没有任何用处)。您可以将断点放在代码语句的函数中。

以下是执行此操作的步骤

To create a method breakpoint using the Breakpoints dialog
1) On the main menu, choose Run | View Breakpoints, or press Ctrl+Shift+F8.
2) In the Breakpoints dialog box that opens, click add.
3) Select Method Breakpoint from the drop-down list.
4) In the Add Method Breakpoint dialog box, specify the class name pattern, including the package name, and the name of the desired method.
5)So doing, when the debugging session starts, the application will pause in all classes with the names matching the specified pattern, at the specified method.

如果它崩溃,请添加堆栈跟踪。我喜欢人们在没有明显原因的情况下开始投票给你。我假设你的问题被否决了,因为没有任何细节的
崩溃
被认为是缺乏研究。如果人们能说出他们为什么否决这个问题,我可以改进它。好的,没有堆栈跟踪。我修改了我的问题,因为它没有经常崩溃,只是不会崩溃。实际上,你可以(至少在最新的Eclipse中)。@mskw请告诉我们你正在使用的Eclipse版本我正在使用IntelliJ,我在一条语句中打断了。一点也不。也许这会有帮助@mskw@grepcode成功了!谢谢,如果你把它作为一个答案,我会让它成为正确的答案。@mskw请找到响应和链接以了解更多详细信息