【问题标题】:Error while debugging an Android Widget调试 Android 小部件时出错
【发布时间】:2013-09-24 19:54:49
【问题描述】:

我有一个 Android Widget 应用程序。它是来自this page 的应用程序(我刚刚下载了源代码)。
为了调试这个小部件,我使用this tutorial。 我在代码中放了一个断点(如下提供)。

public static void pushWidgetUpdate(Context context, RemoteViews remoteViews) {
Log.d("message", "fortunately, we have come to this point");

ComponentName myWidget = new ComponentName(context, MyWidgetProvider.class); //breakpoint is here!
AppWidgetManager manager = AppWidgetManager.getInstance(context);
manager.updateAppWidget(myWidget, remoteViews);     
}

当我开始调试过程时,绿色的调试行像往常一样显示在带有断点的行上。但是几秒钟后它消失了,我看到小部件(或调试过程,甚至手机本身的过程)已被终止。在 DDMS 透视图中,该进程不再出现在进程列表中。
为什么调试器会突然停止?

【问题讨论】:

    标签: java android eclipse debugging android-widget


    【解决方案1】:

    我在 StackOverflow 上读到过,调试 Android 应用程序最好通过日志记录 (Log.d(String tag, String log_text). 所以,我还没有找到那个错误的原因,只是通过日志开始调试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-02-03
      • 2021-06-13
      • 2019-01-30
      • 2011-01-02
      • 1970-01-01
      • 1970-01-01
      • 2017-05-16
      相关资源
      最近更新 更多