1. Are you ready for the Galaxy S20? Here is everything we know so far!

im getting error >invalide integer " "<

Discussion in 'Android Development' started by flyhigh427, Jul 14, 2013.

  1. flyhigh427

    flyhigh427 Member
    Thread Starter

    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 (Text):
    1. [SIZE=2]
    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() {
    3.  
    4. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]try[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] {
    5.  
    6.  
    7. String holdcost = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hcost[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().trim();
    8. String holdtickets = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]gTickets[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().trim();
    9. String holdgas = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hgas[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().trim();
    10. String holdmis = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hmis[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().trim();
    11. String holdkenny1 = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hkenny1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().trim();
    12.  
    13. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mycost,mygas,mymis,mykenny1;
    14. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mykenny2;
    15. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mybecky;
    16. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mytickets;
    17. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mychurch;
    18. [/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]) {
    19. mycost = Integer.[I]parseInt[/I](holdcost);
    20. }[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
    21. mycost=0;
    22. }
    23. [/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]) {
    24. mytickets = Integer.[I]parseInt[/I](holdtickets);
    25. }[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
    26. mytickets=0;
    27. }
    28. [/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]) {
    29. mygas = Integer.[I]parseInt[/I](holdgas);
    30. }[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
    31. mygas=0;
    32. }
    33. [/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]) {
    34. mymis = Integer.[I]parseInt[/I](holdmis);
    35. }[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
    36. mymis=0;
    37. }
    38. [/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]) {
    39. mykenny1 = Integer.[I]parseInt[/I](holdkenny1);
    40. }[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
    41. mykenny1=0;
    42. }
    43.  
    44. mytickets = mytickets - mycost;
    45. mytickets = mytickets - mygas;
    46. mytickets = mytickets - mymis;
    47. mytickets = mytickets + mykenny1;
    48. mychurch = mytickets * .1;
    49. mytickets = mytickets - mychurch;
    50. mybecky = mytickets / 2;
    51. mykenny2 = mybecky;
    52. mykenny2 = mykenny2 - mykenny1;
    53. [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hcost[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](holdcost));
    54. [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hchurch[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mychurch));
    55. [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hbecky[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mybecky));
    56. [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hkenny2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mykenny2));
    57.  
    58. }
    59. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]catch[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](Exception e) {
    60. 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);
    61.  
    62. }
    63.  
    64.  
    65.  
    66.  
    67. }
    68. [/LEFT]
    69. [/SIZE]
     



    1. Download the Forums for Android™ app!


      Download

       
  2. flyhigh427

    flyhigh427 Member
    Thread Starter

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


    Code (Text):
    1. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
    2. [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() {
    3.  
    4. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]try[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] {
    5.  
    6.  
    7.  
    8. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mycost = 0;
    9. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mygas = 0;
    10. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mymis = 0;
    11. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mykenny1 = 0;
    12. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mykenny2 = 0;
    13. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mybecky = 0;
    14. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mytickets = 0;
    15. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]double[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] mychurch = 0;
    16.  
    17.  
    18.  
    19. CharSequence holdcost = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hcost[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText();
    20. [/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) {
    21. mycost = Double.[I]parseDouble[/I](holdcost.toString());
    22. }
    23. CharSequence holdtickets = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]gTextView[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText();
    24. [/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) {
    25. mytickets =Double.[I]parseDouble[/I](holdtickets.toString());
    26. }
    27. CharSequence holdgas = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hgas[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText();
    28. [/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) {
    29. mygas = Double.[I]parseDouble[/I](holdgas.toString());
    30. }
    31. CharSequence holdmis = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hmis[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText();
    32. [/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) {
    33. mymis =Double.[I]parseDouble[/I](holdmis.toString());
    34. }
    35. CharSequence holdkenny1 = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hkenny1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText();
    36. [/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) {
    37. mykenny1 = Double.[I]parseDouble[/I](holdkenny1.toString());
    38. }
    39.  
    40. mytickets = mytickets - mycost;
    41. mytickets = mytickets - mygas;
    42. mytickets = mytickets - mymis;
    43. mytickets = mytickets + mykenny1;
    44. mychurch = mytickets * .1;
    45. mytickets = mytickets - mychurch;
    46. mybecky = mytickets / 2;
    47. mykenny2 = mybecky;
    48. mykenny2 = mykenny2 - mykenny1;
    49. [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hcost[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](holdcost));
    50. [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hchurch[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mychurch));
    51. [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hbecky[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mybecky));
    52. [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]hkenny2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(String.[I]valueOf[/I](mykenny2));
    53.  
    54. }
    55. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]catch[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](Exception e) {
    56. 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);
    57.  
    58. }
    59.  
    60.  
    61.  
    62.  
    63. }
    64. [/LEFT]
    65. [/SIZE]
     
Loading...
Similar Threads - getting error >invalide
  1. Deftones1
    Replies:
    2
    Views:
    208
  2. SofTA
    Replies:
    4
    Views:
    377
  3. black duc
    Replies:
    2
    Views:
    220
  4. David Chang
    Replies:
    2
    Views:
    235
  5. sejwalsakshi
    Replies:
    3
    Views:
    1,093
  6. kneerajkumarn
    Replies:
    1
    Views:
    258
  7. anwartan
    Replies:
    0
    Views:
    867
  8. Ahmed Hisham
    Replies:
    1
    Views:
    508
  9. Mikul Patel
    Replies:
    0
    Views:
    522
  10. Mikul Patel
    Replies:
    0
    Views:
    446

Share This Page

Loading...