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 6239047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:19:33+00:00 2026-05-24T11:19:33+00:00

I am trying to take numbers from three EditText boxes that the user fills

  • 0

I am trying to take numbers from three EditText boxes that the user fills in, then through some simple math and the user pressing a button, there needs to be an answer through a textView. Also whenever I launch this app on the emulator it says that it needs to Force close once I click on the button to go to this layout and code. Here is the code:

                 package com.app.one;

import com.app.one.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class monthlyp extends Activity {
int x = 10;
int y= 10;


@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.monthlyp);

      final TextView input = (TextView) findViewById(R.id.editone);           
      final Button btn = (Button) findViewById(R.id.equals);
      final EditText textView13 = (EditText) findViewById(R.id.textView13); 

      btn.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {


            y = Integer.parseInt(input.getText().toString());
            textView13.setText(String.valueOf(y));
        }
      });       
}
    }

I know it only has one EditText area but that’s because I need help adding two more and being able to use them as integers to add/subtract/divide/multiply. The xml has all three edittext boxes and an equals button that will solve what is entered. Thanks for the help and please ask me if you need any more information.

  • 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-24T11:19:34+00:00Added an answer on May 24, 2026 at 11:19 am

    You say that input is a textview

    final TextView input = (TextView) findViewById(R.id.editone);    
    

    then you got the integer value of that textview

    y = Integer.parseInt(input.getText().toString());
    

    I suggest that’s not what you intended

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

Sidebar

Related Questions

I have a program that I am trying to take a set of numbers
I am trying to create a program that will take user inputs(marks) and output
I'm trying to take two 7 digit numbers (source and target record counts) and
I'm trying to make a PHP script that will take a potentially infinite number
I am trying to take a shapefile of subdivisions within a county that I
I am currently using NSURLConnection to download some date from a database through a
I'm trying to work through a small Perl learning project that requires reading 4
Hi I'm trying to create a simple music library for my application that uses
I'm trying to parse some JSON data from the Google AJAX Search API. I
I am trying to take the JSON results from an MVC3 action and push

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.