为了账号安全,请及时绑定邮箱和手机立即绑定

为什么我的应用程序会因“NumberFormatException”而崩溃?

为什么我的应用程序会因“NumberFormatException”而崩溃?

犯罪嫌疑人X 2021-09-15 14:47:28
我的应用程序在点击准入布局时崩溃,但它并没有因为所有登录凭据而崩溃,只有某些 ID 崩溃了。这完全取决于登录帐户。我有 100 个帐户,我尝试使用所有不同的凭据登录,但只有几个登录帐户崩溃了。以下是日志: LIST_ADMISSION: [ListEnquiryItem{paid_fees = '',fname = '',course_id = '5',address = 'thank you for',discount_fees = '',course_name = '11th',batch_id = '4',subject = 'Science,Hindi,English',total_fees = '10000',mobile = '9999999999',photo = 'http://webytechno.com/ClassBro/admin/uploads/1536226227055.jpg',medium = '',date1 = '2018-09-06',fmobile = '',reference = '',password = 'g3gkba',batch_name = 'Evening's Batch',remaining_fees = '10000',school = '',sname = 'adil',dob = '2018-09-06',id = '402',email = '',username = 'adilfrn'}, ListEnquiryItem{paid_fees = '9000',fname = 'Kasim mulla',course_id = '30',address = 'jdv jabs jdbbs',discount_fees = '500',course_name = 'tybms',batch_id = '36',subject = 'sub1,sub2,sub3',total_fees = '12000',mobile = '7414969600',photo = 'http://webytechno.com/ClassBro/admin/uploads/1526708605633.jpg',medium = 'English',date1 = '2018-05-19',fmobile = '8355893913',reference = 'Imram',password = 'jy8g6t',batch_name = 'tybms morning',remaining_fees = '2500',school = 'vvuc',sname = 'Daud',dob = '2018-05-19',id = '57',email = 'daud@gmail.con',username = 'pmd17t'}, ListEnquiryItem{paid_fees = '1000',fname = 'cyz',course_id = '1',address = 'gaahha',discount_fees = '500',course_name = '10th class',batch_id = '2',subject = 'English,Hindi,Gujarati,Science',total_fees = '25000',mobile = '9875461312',photo = 'http://webytechno.com/ClassBro/admin/uploads/1525085910070.jpg',medium = 'eng',date1 = '2018-04-30',fmobile = '0784945431',reference = e',total_fees = '25000',mobile = '4799497979',photo = 
查看完整描述

2 回答

?
森林海

TA贡献2011条经验 获得超2个赞

你有一个java.lang.NumberFormatException.

发生这种情况是因为您调用Integer.parseInt了一个空字符串。

由于这种情况只发生在少数帐户中,我假设他们的密码为空,并且您尝试登录发送空密码,如果您接受字符串密码作为发送字符串而不是尝试将它们转换为整数,那就可以了.


查看完整回答
反对 回复 2021-09-15
?
繁星coding

TA贡献1797条经验 获得超4个赞

您正在使用parseInt()方法并将字符串变量传递给它。如果您的 ID 是字符串,请为此使用字符串变量。


查看完整回答
反对 回复 2021-09-15
  • 2 回答
  • 0 关注
  • 198 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信