java - error:NumberFormatException unable to parse '20' -


public void onpass(view v)     {          string sn1=et1.gettext().tostring();         string sn2=et2.gettext().tostring();          int i1=integer.parseint(sn1);         int i2=integer.parseint(sn2);         intent i=new intent(this,act2.class);         i.putextra("k1",i1 );         i.putextra("k2", i2);                startactivity(i);             } 

logcat :

e/androidruntime(671): caused by: java.lang.numberformatexception: unable parse '20 ' integer 

you have white space @ end of string. that's problem. you'll need trim it.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -