首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为什么我不能在Android SDK内部设置断点?

为什么我不能在Android SDK内部设置断点?
EN

Stack Overflow用户
提问于 2014-07-18 04:04:57
回答 2查看 201关注 0票数 0

我尝试通过将断点放在以下位置来查找应用程序的入口点

代码语言:javascript
运行
复制
onCreate

在Activity.java内部,但在这一点上它从不中断。这是允许的还是可能的?

这里是我的断点所在

代码语言:javascript
运行
复制
   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()中中断,但当我进入时,它一进入就直接跳过了所有东西。

EN

回答 2

Stack Overflow用户

发布于 2014-07-18 04:07:47

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

票数 1
EN

Stack Overflow用户

发布于 2014-07-20 21:38:33

以下是执行此操作的步骤。

代码语言:javascript
运行
复制
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.

link将为您提供更多详细信息

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24812526

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档