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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:12:07+00:00 2026-05-27T16:12:07+00:00

I am trying to open my calculator and value from it then I am

  • 0

I am trying to open my calculator and value from it then I am done here is my code for my page (where the main point is as it shows how I tried to get result)

TextView.OnClickListener listener = new TextView.OnClickListener()
{
    public void onClick(View v) 
    {
        startActivityForResult(new Intent("com.easyPhys.start.calculator"), 1);
    }
};   

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) 
{
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    if(resultCode==1)
    {
        Toast.makeText(this, "Pass", Toast.LENGTH_LONG).show();
    }
}

this is how I tried to give a result from calculator.java:

mClickListener = new ButtonClickListener();
int idList[] = { R.id.button0, R.id.button1, R.id.button2,
R.id.button3, R.id.button4, R.id.button5, R.id.button6,
R.id.button7, R.id.button8, R.id.button9, R.id.buttonLeftParen,
R.id.buttonRightParen, R.id.buttonPlus, R.id.buttonDone,
R.id.buttonMinus, R.id.buttonDivide, R.id.buttonTimes,
R.id.buttonDecimal, R.id.buttonBackspace, R.id.buttonClear, R.id.buttonPow,   R.id.buttonSin, R.id.buttonCos,R.id.buttonTan,R.id.buttonAcos,R.id.buttonAtan,R.id.buttonAsin,R.id.buttonLog,R.id.buttonLog10,R.id.buttonComma,R.id.buttonToradians,R.id.buttonTodegrees };

       for(int id : idList) {
       View v = findViewById(id);
       v.setOnClickListener(mClickListener);
       }

       private class ButtonClickListener implements OnClickListener {

       @Override
       public void onClick(View v) {
       case R.id.buttonDone:

       if(mMathString.length() > 0);

   Bundle bundle = new Bundle();
   bundle.putString("str", mMathString.toString());

   Intent in = new Intent();
   in.putExtras(bundle);
   setResult(1, in);


new View.OnClickListener() {     
   @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub      
   finish();
  }
   };
    break;

can anyone help me to understand where I went wrong as program does not close and give an answer?

  • 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-27T16:12:07+00:00Added an answer on May 27, 2026 at 4:12 pm

    Have you verified that your onClick method is being called? The reason I ask is that you show the code for onClick but you don’t show that you set this for the equals button by calling setOnClickListener.

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

Sidebar

Related Questions

I´m trying to open a tab using jquery, here is my code: $(#ecContenedorFolders).tabs({ tabTemplate:
I'm trying to open a file and read from the last point read. My
I m trying to open Notepad, Calculator in button click in asp.net with code
I'm trying to open a JSON file from the assets folder with an InputStream
I'm trying to open a file in Openoffice from terminal and to automatically replace
I'm trying to experiment with software defined radio concepts. From this article I've tried
When trying to open a file using this command: $fd = fopen('majestic_files/majestic_record.txt','w'); I get
SO i am trying to get the value or the contents of an HTML
While trying to open an excel using ApachePOI I get org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the
we are trying to retrieve a calculated value from a cell which has add-In

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.