Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old July 14th, 2013, 03:12 PM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Jan 2013
Posts: 53
 
Device(s):
Carrier: Not Provided

Thanks: 11
Thanked 1 Time in 1 Post
Default im getting error >invalide integer " "<

hi the app still runs the right way ,i just get that error
how would i solve that one?

and if i could ask another question about .
(question 2) how do i write text to a given line number
on an edittext ?
reason i need to save this in a text file on my sdcard im able to do that
just not able to insert at a given line number.

thanks

line #1>>turkey leg 1 2
line #2>>links 2 6




Code:

privatevoid totaltickets() { try { String holdcost = hcost.getText().toString().trim(); String holdtickets = gTickets.getText().toString().trim(); String holdgas = hgas.getText().toString().trim(); String holdmis = hmis.getText().toString().trim(); String holdkenny1 = hkenny1.getText().toString().trim(); double mycost,mygas,mymis,mykenny1; double mykenny2; double mybecky; double mytickets; double mychurch; if (holdcost != "") { mycost = Integer.parseInt(holdcost); }else{ mycost=0; } if (holdtickets != "") { mytickets = Integer.parseInt(holdtickets); }else{ mytickets=0; } if (holdgas != "") { mygas = Integer.parseInt(holdgas); }else{ mygas=0; } if (holdmis != "") { mymis = Integer.parseInt(holdmis); }else{ mymis=0; } if (holdkenny1 != "") { mykenny1 = Integer.parseInt(holdkenny1); }else{ mykenny1=0; } mytickets = mytickets - mycost; mytickets = mytickets - mygas; mytickets = mytickets - mymis; mytickets = mytickets + mykenny1; mychurch = mytickets * .1; mytickets = mytickets - mychurch; mybecky = mytickets / 2; mykenny2 = mybecky; mykenny2 = mykenny2 - mykenny1; hcost.setText(String.valueOf(holdcost)); hchurch.setText(String.valueOf(mychurch)); hbecky.setText(String.valueOf(mybecky)); hkenny2.setText(String.valueOf(mykenny2)); } catch(Exception e) { Log.e("Error tickets", "Error tickets", e); } }

flyhigh427 is offline  
Reply With Quote
sponsored links
Old July 14th, 2013, 05:20 PM   #2 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Jan 2013
Posts: 53
 
Device(s):
Carrier: Not Provided

Thanks: 11
Thanked 1 Time in 1 Post
Default

hey i got an answer to the first question that seems to work been haveing that problem for awhile.


Code:

private
void totaltickets() { try { double mycost = 0; double mygas = 0; double mymis = 0; double mykenny1 = 0; double mykenny2 = 0; double mybecky = 0; double mytickets = 0; double mychurch = 0; CharSequence holdcost = hcost.getText(); if(holdcost != null && holdcost.length() > 0) { mycost = Double.parseDouble(holdcost.toString()); } CharSequence holdtickets = gTextView.getText(); if (holdtickets != null && holdtickets.length() > 0) { mytickets =Double.parseDouble(holdtickets.toString()); } CharSequence holdgas = hgas.getText(); if(holdgas != null && holdgas.length() > 0) { mygas = Double.parseDouble(holdgas.toString()); } CharSequence holdmis = hmis.getText(); if (holdmis != null && holdmis.length() > 0) { mymis =Double.parseDouble(holdmis.toString()); } CharSequence holdkenny1 = hkenny1.getText(); if(holdkenny1 != null && holdkenny1.length() > 0) { mykenny1 = Double.parseDouble(holdkenny1.toString()); } mytickets = mytickets - mycost; mytickets = mytickets - mygas; mytickets = mytickets - mymis; mytickets = mytickets + mykenny1; mychurch = mytickets * .1; mytickets = mytickets - mychurch; mybecky = mytickets / 2; mykenny2 = mybecky; mykenny2 = mykenny2 - mykenny1; hcost.setText(String.valueOf(holdcost)); hchurch.setText(String.valueOf(mychurch)); hbecky.setText(String.valueOf(mybecky)); hkenny2.setText(String.valueOf(mykenny2)); } catch(Exception e) { Log.e("Error tickets", "Error tickets", e); } }
flyhigh427 is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:59 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.