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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:55:33+00:00 2026-06-18T04:55:33+00:00

I have made a simple android app,i that some calculations are there from 1

  • 0

I have made a simple android app,i that some calculations are there from 1 activity’s EditText value some multiplication,sum and other mathematical procedures and showing results as double in another activities edittexs.so can anyone please tell me is it necessary to cast string value to “double” for making calculation and how can i do it?

Activity1.java

Intent ic = new Intent(Calculator_1Activity.this,Calculator2a.class);
        ic.putExtra("e1", et1.getText().toString());
        ic.putExtra("e2", et2.getText().toString());
        ic.putExtra("e3", et3.getText().toString());
        ic.putExtra("e4", et4.getText().toString());
        ic.putExtra("e5", et5.getText().toString());
        ic.putExtra("e6", et6.getText().toString());
        ic.putExtra("e7", et7.getText().toString());
        ic.putExtra("e8", et8.getText().toString());

        startActivity(ic);

and i fetch its values in activity2a,but can’t do calculations….pls help..:(

Activity2a.java

  Intent receiveIntent = this.getIntent();
        String etz1 = receiveIntent.getStringExtra("e1");
        String etz2 = receiveIntent.getStringExtra("e2");
        String etz3 = receiveIntent.getStringExtra("e3");
        String etz4 = receiveIntent.getStringExtra("e4");
        String etz5 = receiveIntent.getStringExtra("e5");
        String etz6 = receiveIntent.getStringExtra("e6");
        String etz7 = receiveIntent.getStringExtra("e7");
        String etz8 = receiveIntent.getStringExtra("e8");

        et1.setText(etz1);
        et2.setText(etz2);
        et3.setText(etz3);
        et4.setText(etz4);
        et5.setText(etz5);
        et6.setText(etz6);
        et7.setText(etz7);
        et8.setText(etz8);

please help me

  • 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-18T04:55:35+00:00Added an answer on June 18, 2026 at 4:55 am

    do something like below

            Intent receiveIntent = this.getIntent();
            String etz1 = receiveIntent.getStringExtra("e1");
    
            double erz1Double = Double.parseDouble(etz1); //converting into double
          // follow same for all the string values, dont forget to add try Catch for number formatException, and null check for string values
    

    Edit:- for casting double to string, there are many ways can do something like below

     String erz1String = erz1Double + "";
    
           or
    
    
     String erz1String = String.valueOf(erz1Double);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a simple android application that moves from one activity to another activity
I am trying to create a simple 3-D app for android that will have
I have made a simple android project with a single activity containing three buttons
I'm just beginning Android and have gotten myself stuck. I've made a simple app/view.
I have a table in my android app that is very simple. Has an
Beginner in Android development. My code crashes. I have made a simple Java method
I have made simple encryption/decryption method in php that I'm trying to move to
I have made a simple web form in Google app engine where I have
I have made a working clock widget app in android but would like it
I have an app that was originally styled for Android 2.3. Now I'm adding

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.