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

  • Home
  • SEARCH
  • 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 6980497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:01:37+00:00 2026-05-27T18:01:37+00:00

when clicking on the button it does nothing ,,,after testing I concluded the problem

  • 0

when clicking on the button it does nothing ,,,after testing I concluded the problem is with the equal method statment ,,,the whole issue is when comparing string array to string any solutions?

EditText coderead = (EditText)findViewById(R.id.editText1);
        Button   go       = (Button)findViewById(R.id.button1); 
        final String mn=coderead.getText().toString();          
            final String code[] = {"m1","n2"};
            final double pointx[] ={23.666666,65.22222};
            final double pointy[] ={31.55555,29.665544};

        go.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent transfercode = new Intent(getApplicationContext(), FeenbezabtActivity.class);

                for (int i=0; i<code.length; i++) {
                    if(code[i].equals(mn)) {
                        transfercode.putExtra("lat2", pointx[i]);
                        transfercode.putExtra("long", pointy[i]);
                    startActivity(transfercode);
                    }

                    else{Toast.makeText(getBaseContext(), "code not found", 5000);}
                }
            }
        });
  • 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-27T18:01:38+00:00Added an answer on May 27, 2026 at 6:01 pm

    Your mn variable should be read after your button has been clicked.

    Button go  = (Button) findViewById(R.id.button1); 
    final String code[] = {"m1", "n2"};
    final double pointx[] = {23.666666, 65.22222};
    final double pointy[] = {31.55555, 29.665544};
    
    go.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent transfercode = new Intent(getApplicationContext(), FeenbezabtActivity.class);
    
            // mn should be read after the button click!
            EditText coderead = (EditText) findViewById(R.id.editText1);
            final String mn = coderead.getText().toString();          
    
            for (int i = 0; i < code.length; i++) {
                if (code[i].equals(mn)) {
                    transfercode.putExtra("lat2", pointx[i]);
                    transfercode.putExtra("long", pointy[i]);
                    startActivity(transfercode);
                } else {
                    Toast.makeText(getBaseContext(), "code not found", 5000);
                }
            }
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I get to increment a textbox content after clicking on a button?
I have website that is ASP.NET with Forms Authentication, clicking the logout button does
I have the following situation: after clicking a button, some business logic is done
I have added a MKUserTrackingBarButtonItem to my toolbar. But, clicking it does nothing. So,
Problem After downloading a CSV once, the form does not send a request on
On clicking a button, I want the selected rows to be inverted (non-selected rows
I'm trying to dispose my JFrame by clicking a button, located on a JPanel
When I want to Display a form (C#) by clicking a button in another
I have a GUI program with one Exit button. When clicking this button, it
I work on Asp.Net VS08 C#. Clicking on Button want to show popup. popup

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.