简体   繁体   English

我以为我删除了我应用程序中的所有错误,但是这个错误不断弹出……Android应用程序

[英]I thought I removed all bugs in my app but this one keeps popping up… Android app

I keep getting this error in my google log. 我在Google日志中不断收到此错误。 Can anyone point me in the direction of how to decipher the problem here. 谁能指出我在这里如何解决问题的方向。 crash is: Exception class java.lang.NumberFormatException Source method FloatingPointParser.parseDouble() 崩溃是:异常类java.lang.NumberFormatException源方法FloatingPointParser.parseDouble()

java.lang.NumberFormatException:
at org.apache.harmony.luni.util.FloatingPointParser.parseDouble(FloatingPointParser.java:267)
at java.lang.Double.parseDouble(Double.java:318)
at com.pipe.fittings.kevin.EqualSpreadOffset$1.onClick(EqualSpreadOffset.java:283)
at android.view.View.performClick(View.java:2532)
at android.view.View$PerformClick.run(View.java:9293)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4306)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)

Thanx all. 谢谢大家。

explanation of NumberFormatException here: 这里对NumberFormatException的解释:

http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/NumberFormatException.html http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/NumberFormatException.html

it looks like there is an attempt to parse a string into a Double and it is failing there. 似乎有尝试将字符串解析为Double的操作,但尝试失败。

Use number parsing - you probablly want use String as number. 使用数字解析-您可能希望使用String作为数字。 Remember about integer.parseint and other helpers like this 记住有关integer.parseint和类似这样的其他帮助器

Try catching your exceptions and maybe this won't happen. 尝试捕获您的异常,也许这不会发生。 A number format exception occurs when a string that is not a number is being attempted to be converted into a number. 当试图将非数字的字符串转换为数字时,会发生数字格式异常。

For instance, if "kel" was trying to be turned into a number it would throw that exception because kel is not a number (obviously). 例如,如果“ kel”试图转换为数字,则将抛出该异常,因为kel不是数字(显然)。 Just look up try and catch and learn basic java and learn to read what your errors mean. 只需查找并抓住并学习基本的Java,然后学习阅读错误的含义即可。

By looking at your stacktrace, it looks like you should examine the line: 通过查看您的堆栈跟踪,看起来您应该检查以下行:

com.pipe.fittings.kevin.EqualSpreadOffset$1.onClick(EqualSpreadOffset.java:283)

I'm guessing (like the others here) that your attempting to convert something that is not a number into a number and it is throwing an exception. 我猜(像这里的其他人一样),您试图将非数字转换为数字,并引发异常。

The $1 indicates that the error is occurring the the first anonymous class within the class EqualSpreadOffset. $ 1表示错误发生在类EqualSpreadOffset中的第一个匿名类中。 I will go out on a limb here and guess that it is probably a user entered field that is not properly validated before it is passed to your onClick method handler. 在这里,我将不胜枚举,猜测它可能是用户输入的字段,在传递给您的onClick方法处理程序之前,该字段未得到正确验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM