• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps im getting error >invalide integer " "<

flyhigh427

Member
Jan 10, 2013
53
1
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:
[SIZE=2]
[LEFT][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] totaltickets() {

[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]try[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] {


String holdcost = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hcost[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().trim();
String holdtickets = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]gTickets[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().trim();
String holdgas = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hgas[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().trim();
String holdmis = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hmis[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().trim(); 
String holdkenny1 = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hkenny1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().trim();

[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mycost,mygas,mymis,mykenny1;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mykenny2;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mybecky;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mytickets;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mychurch; 
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (holdcost != [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) {
mycost = Integer.[I]parseInt[/I](holdcost);
}[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
mycost=0; 
} 
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (holdtickets != [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) {
mytickets = Integer.[I]parseInt[/I](holdtickets);
}[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
mytickets=0; 
} 
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (holdgas != [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) {
mygas = Integer.[I]parseInt[/I](holdgas);
}[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
mygas=0; 
} 
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (holdmis != [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) {
mymis = Integer.[I]parseInt[/I](holdmis);
}[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
mymis=0; 
} 
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (holdkenny1 != [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) {
mykenny1 = Integer.[I]parseInt[/I](holdkenny1);
}[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
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; 
[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hcost[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](holdcost)); 
[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hchurch[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mychurch));
[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hbecky[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mybecky));
[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hkenny2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mykenny2));

}
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]catch[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](Exception e) {
Log.[I]e[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Error tickets"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Error tickets"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], e);

}




}
[/LEFT]
[/SIZE]
 
hey i got an answer to the first question that seems to work been haveing that problem for awhile.


Code:
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
[LEFT]private[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] totaltickets() {

[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]try[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] {



[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mycost = 0;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mygas = 0;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mymis = 0;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mykenny1 = 0;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mykenny2 = 0;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mybecky = 0;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mytickets = 0;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mychurch = 0; 



CharSequence holdcost = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hcost[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText(); 
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](holdcost != [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] && holdcost.length() > 0) {
mycost = Double.[I]parseDouble[/I](holdcost.toString()); 
} 
CharSequence holdtickets = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]gTextView[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText();
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (holdtickets != [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] && holdtickets.length() > 0) {
mytickets =Double.[I]parseDouble[/I](holdtickets.toString()); 
} 
CharSequence holdgas = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hgas[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText(); 
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](holdgas != [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] && holdgas.length() > 0) {
mygas = Double.[I]parseDouble[/I](holdgas.toString()); 
} 
CharSequence holdmis = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hmis[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText();
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (holdmis != [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] && holdmis.length() > 0) {
mymis =Double.[I]parseDouble[/I](holdmis.toString()); 
} 
CharSequence holdkenny1 = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hkenny1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText(); 
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](holdkenny1 != [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] && holdkenny1.length() > 0) {
mykenny1 = Double.[I]parseDouble[/I](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; 
[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hcost[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](holdcost)); 
[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hchurch[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mychurch));
[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hbecky[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mybecky));
[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hkenny2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mykenny2));

}
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]catch[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](Exception e) {
Log.[I]e[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Error tickets"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Error tickets"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], e);

}




}
[/LEFT]
[/SIZE]
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones