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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:13:34+00:00 2026-06-15T17:13:34+00:00

I am having a problem getting the value in the editText of my program.

  • 0

I am having a problem getting the value in the editText of my program. I set the value in a textView so that I can see if the code gets it. But unfortunately it displays something like this:

android.widget.EditText@410e5a58 -> the number after @ sign changes every run in the emulator

Why this happens? This is my code:

package com.example.ITax;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

/**
* Created with IntelliJ IDEA.
* User: Karla Mae Jaro
* Date: 12/3/12
* Time: 3:58 PM
* To change this template use File | Settings | File Templates.
*/
public class AnnualComputation extends MyActivity
{
String civil_status2;

public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.annual_computation);

    Bundle extras = getIntent().getExtras();

    if(extras != null)
    {
        civil_status2 = extras.getString("user_status");
    }

    final Button btn_compute = (Button) findViewById(R.id.btn_compute_from_annual);
    final Button btn_back = (Button) findViewById(R.id.btn_back_from_annual_computation);

    btn_back.setOnClickListener(new Button.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            Intent i = new Intent(getApplicationContext(), OpenChoices.class);
            startActivity(i);
        }
    });

    btn_compute.setOnClickListener(new Button.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            final EditText net_salary = (EditText) findViewById(R.id.et_net_annual);
            final EditText tax_due = (EditText) findViewById(R.id.et_taxdue);
            final EditText tax_exe = (EditText) findViewById(R.id.et_taxexemption);

            final TextView txt3 = (TextView) findViewById(R.id.textView3);
            final TextView txt4 = (TextView) findViewById(R.id.textView4);
            final TextView txt5 = (TextView) findViewById(R.id.textView5);
            final TextView txt6 = (TextView) findViewById(R.id.textView6);
            final TextView txt7 = (TextView) findViewById(R.id.textView7);
            final TextView txt8 = (TextView) findViewById(R.id.textView8);


            double netSalary, taxDue, rate = 0, exemption = 0, additional = 0, lowerlimit = 0, total;
            String ns, td, r, e, a, t;

            ns = net_salary.getText().toString();
            netSalary = Double.parseDouble(ns);

            /* Getting the tax exemption */

            if ("SME".equals(civil_status2))
            {
                exemption = 50000;
            }

            else if ("SM1".equals(civil_status2))
            {
                exemption = 25000;
            }

            else if ("SM2".equals(civil_status2))
            {
                exemption = 50000;
            }

            else if ("SM3".equals(civil_status2))
            {
                exemption = 75000;
            }

            else if ("SM4".equals(civil_status2))
            {
                exemption = 100000;
            }

            /* Getting the rate, additional, lowerlimit */

            if(netSalary <= 10000)
            {
                rate = 0.05;
            }

            else if((netSalary > 10000) && (netSalary <=30000))
            {
                rate = 0.1;
                additional = 5000;
                lowerlimit = 10000;
            }

            else if ((netSalary > 30000) && (netSalary <= 70000))
            {
                rate = 0.15;
                additional = 2500;
                lowerlimit = 30000;
            }

            else if((netSalary > 70000) && (netSalary <= 14000))
            {
                rate = 0.20;
                additional = 8500;
                lowerlimit = 70000;
            }

            else if ((netSalary > 140000) && (netSalary <= 250000))
            {
                rate = 0.25;
                additional = 22500;
                lowerlimit = 140000;
            }

            else if((netSalary > 250000) && (netSalary <= 500000))
            {
                rate = 0.30;
                additional = 50000;
                lowerlimit = 250000;
            }

            else if (netSalary > 500000)
            {
                rate = 0.32;
                additional = 125000;
                lowerlimit = 500000;
            }

            taxDue = netSalary - exemption;
            total = taxDue - lowerlimit;
            total = total * rate;
            total = total + additional;

             /* Converting exemption from Double to String */


            td = String.valueOf(net_salary);
            e = String.valueOf(exemption);
            a = String.valueOf(additional);
            r = String.valueOf(rate);
            t = String.valueOf(total);

             /* Placing the value to the editText (textbox) */

            tax_due.setText(td);
            tax_exe.setText(e);
            txt3.setText(civil_status2);
            txt4.setText(td);
            txt5.setText(e);
            txt6.setText(t);
            txt7.setText(r);
            txt8.setText(a);

        }
    });
}
}
  • 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-06-15T17:13:36+00:00Added an answer on June 15, 2026 at 5:13 pm

    use netSalary instead of net_salary

    td = String.valueOf(netSalary);
    

    As you are passing the edit text instead of the double variable

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

Sidebar

Related Questions

I am having a problem setting/getting a hidden input's value with JavaScript, and can't
Greetings! I'm having a problem getting a text value of a captcha from a
I am having problem getting this piece of code to run. The class is
I'm having a problem getting a change event to register with the following code:
I'm having a problem getting XCode to deal with a particular file structure that
I'm having a problem with getting and dropping the first value from list in
I have an asp.net c# website that I am having a problem getting the
I am having a problem in getting the html input value in the ruby
I'm having a problem in the dry run of a program. I'm not getting
G'day, I'm having a problem getting the right value to post on a form

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.