0

我目前有一个buzztouch android应用程序的问题我从google play创建的错误是

NullPointerException
in BT_viewUtilities.updateBackgroundColorsForScreen()

我已将其范围缩小到以下代码,是否有人在代码中看到任何类型的错误。如果您需要其他东西,请询问,这将修复相当多的应用程序。谢谢

//updates a screens background colors and image...
public static void updateBackgroundColorsForScreen(final Activity theActivity, final          BT_item theScreenData){
BT_debugger.showIt(objectName + ":updateBackgroundColorsForScreen with nickname: \"" +     theScreenData.getItemNickname() + "\""); 
4

3 回答 3

2

我不知道你的代码在做什么,但修复很简单:

//updates a screens background colors and image...
public static void updateBackgroundColorsForScreen(final Activity theActivity, final BT_item theScreenData){
     if(BT_debugger != null && theScreenData != null){
          BT_debugger.showIt(objectName + ":updateBackgroundColorsForScreen with nickname: \"" +     theScreenData.getItemNickname() + "\""); 
     } else {
         Log.e("YourApp", "Warning null var, command not completed");
     }
}

要调试错误,您可以执行以下操作:

    //updates a screens background colors and image...
    public static void updateBackgroundColorsForScreen(final Activity theActivity, final BT_item theScreenData){
         if(BT_debugger != null){
             if(theScreenData != null){
                BT_debugger.showIt(objectName + ":updateBackgroundColorsForScreen with nickname: \"" +     theScreenData.getItemNickname() + "\""); 
             } else {
                Log.e("YourApp", "theScreenData was null, command not completed");
             }
         } else {
             Log.e("YourApp", "BT_debugger was null, command not completed");
         }
    }
于 2012-05-24T19:28:41.753 回答
2

theScreenData 或 BT_debugger 为空。

于 2012-05-24T19:24:25.790 回答
1

我认为这是导致空点异常的行-theScreenData.getItemNickname()

于 2012-05-24T19:28:13.690 回答