Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4015928
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:40:42+00:00 2026-05-20T09:40:42+00:00

I am new to Android programming, and I am making a number guessing game

  • 0

I am new to Android programming, and I am making a number guessing game to get to know the basic Android code. In my program, I have an EditText (basically a TextField) and I was wondering how I would change whatever the user inputs into an int. So far I have tried Integer.parseInt(string), but it didn’t work. Here is the code that I have right now:

EditText textfield = (EditText) findViewById(R.id.textfield);
String label = textfield.getText().toString();
int guess = Integer.parseInt(label);

When I run this program to debug on my phone, it all works fine until I press the button that I call this code with. When I press the button, the program closes and a popup comes that says

“The application Test (process com.android.test) has stopped unexpectedly. Please try again.”

This happens every time I try to run the program. I have debugged, and I have isolated the problem to the line of code that parses the int. How do I make this work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:40:43+00:00Added an answer on May 20, 2026 at 9:40 am

    You’re likely getting a NumberFormatException, but that isn’t enough to help you except temporarily.

    What you need to do is become familiar with some of the Android debugging facilities.

    Start the phone emulator using the platform tools.

    Open a command prompt and navigate to your android-sdk\platform-tools directory.

    Run adb logcat to connect to the running emulator. In the emulator, run your program and cause the error to occur. You will get a stack trace in your command line window to help you isolate your problem.

    Check out how to use LogCat on the dev site.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Java programming, I am programming Java 1.6 with Android. I have
I am new to Android Programming. I need to display a Pop-Up message in
I'm new to Android and Java programming and I've manage to create a simple
I want to learn a new programming language and develop for the Android platform.
I am a new to developing for Android and have been reading up and
Im fairly new at programming and was wondering if the Jigloo gui builder plugin
I'm relatively new to programming in general so be gentle =| I'm trying to
I am a beginner in programming with Java Android. I am currently confused with
I am programming an app that eventually will have several Activities. Right now, however,
I am having a couple problems with the code from the tutorial: ListView Tutorial

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.