Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Android Character.getNumericValue returns -1

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Android Character.getNumericValue returns -1

    I'm programming for Android and I'm using Character.getNumericValue but it's returning negative for space (' ', ASCII #31) and the exclamation mark ('!', ASCII #33) and likely the others that I haven't checked yet. Why isn't it returning the proper ASCII value?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Android Character.getNumericValue returns -1

    What numeric value does ' ' have? Are you using the right method or technique to get its value?
    If you don't understand my answer, don't ignore it, ask a question.

  3. The Following User Says Thank You to Norm For This Useful Post:

    polyfrag (January 24th, 2013)

  4. #3
    Junior Member
    Join Date
    Jul 2012
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Android Character.getNumericValue returns -1

    Never mind, I can just use type-casting to convert char to int.

Similar Threads

  1. PrintJobListener Always Returns printJobNoMoreEvents
    By Basak in forum What's Wrong With My Code?
    Replies: 5
    Last Post: June 28th, 2011, 06:50 AM
  2. Array list returns null
    By Scotty in forum Collections and Generics
    Replies: 3
    Last Post: April 14th, 2011, 06:50 AM
  3. returns all suggestions
    By mario_tim in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 26th, 2011, 04:51 AM
  4. Space Monkey Returns
    By SPACE MONKEY in forum Member Introductions
    Replies: 1
    Last Post: February 17th, 2011, 09:59 AM
  5. The character '' is an invalid XML character exception getting
    By sumanta in forum What's Wrong With My Code?
    Replies: 5
    Last Post: January 9th, 2010, 12:13 PM