我尝试使用某种方法来处理String
......但我得到了
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String kuros.com.ipsiscontroller.stringFilter.setStringParam(java.lang.String)' on a null object reference
at kuros.com.ipsiscontroller.AddActivity.getParameters(AddActivity.java:147)
stringFilter.class
String setStringParam(String parameter){
/*String finalParam = "";
String fillString = "";
if (parameter.length() < LENGTH_PARAMETERS) {
int missingChars = LENGTH_PARAMETERS - parameter.length();
Log.d("STRING_TAG missingChars", String.valueOf(missingChars));
for (int i = 0; i < missingChars; i++) {
//fillString = fillString + "x";
fillString += "x";
}
}
finalParam = parameter + fillString;
Log.d("STRING_TAG", finalParam);*/
return parameter;
}
正如你所看到的,我对该方法的评论最多,只是为了看到我得到同样的String
...但是也没有用。
这是第147行。
String test = sf.setStringParam("a");
答案 0 :(得分:-2)
该方法不是静态的,因此您需要<div id="Options_0__Completed-styler" class="jq-radio" unselectable="on" style="-webkit-user-select: none; display: inline-block; position: relative;">
<input id="Options_0__Completed" name="Options[0].Completed" type="radio" value="True" style="position: absolute; z-index: -1; opacity: 0; margin: 0px; padding: 0px;">
<div class="jq-radio__div"></div>
</div>
<div id="Options_0__Completed-styler" class="jq-radio checked" unselectable="on" style="-webkit-user-select: none; display: inline-block; position: relative;">
<input checked="checked" id="Options_0__Completed" name="Options[0].Completed" type="radio" value="False" style="position: absolute; z-index: -1; opacity: 0; margin: 0px; padding: 0px;">
<div class="jq-radio__div"></div>
</div>
的实例来调用该方法。
您正在stringFilter