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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:05:05+00:00 2026-06-13T23:05:05+00:00

The problem in EditText is, it is not returning the input value.I am using

  • 0

The problem in EditText is, it is not returning the input value.I am using that input value to check condition.

I am giving the correct input so that i checks the if condition and go to next activity but
it always goes to else condition.

Please check the code below, i had commented the problem.

Here is the snippet

public class BuildWord extends Activity
{
String word = "word";
String finished = "Word Built";

@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.buildword);

    EditText get = (EditText)findViewById(R.id.dataToSend);
    String getdata = get.getText().toString(); //Here i am getting Data from EditText

    displayIntentData();

    if (getdata.equals("word")) 

    //Here i am checking with "word" but it goes to else condition.I am typing "word" only
    {
        findViewById(R.id.sendButton1).setOnClickListener(new OnClickListener() 
        {   
            public void onClick(View v) 
            {
                Intent intent = new Intent(BuildWord.this,MainActivity.class);
                intent.putExtra("key", word);
                startActivity(intent);

            }
        });
    }
    else
    {
        findViewById(R.id.sendButton1).setOnClickListener(new OnClickListener() 
        {   
            public void onClick(View v) 
            {
                Intent intent = new Intent(BuildWord.this,DropCard.class);
                intent.putExtra("key", finished);
                startActivity(intent);                  
            }
        });
    }
}

@Override
protected void onNewIntent(Intent intent) 
{
    super.onNewIntent(intent);
    setIntent(intent);
    displayIntentData();
}

private void displayIntentData()
{
    Intent intent = getIntent();
    TextView tv = (TextView)findViewById(R.id.intentData1);
    Bundle extras=intent.getExtras();

    if(extras!=null)
    {
        tv.setText("Data received: "+extras.getString("key"));
    }
    else
    {
        tv.setText("No extradata received");
    }
}

}

  • 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-13T23:05:05+00:00Added an answer on June 13, 2026 at 11:05 pm

    After displayIntentData(); declare String getdata = get.getText().toString();

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

Sidebar

Related Questions

problem with making edittext scrollable there is mentioned that it is not scrollable with
I have a problem with my custom view that contains an edittext and a
i have 1 edittext with number input only.the problem is,suppose user types 1234 no
I have an EditText inside a PopupWindow. The problem is that when i touch
I'm using EditText.setError(..) to show up an error message if the user did not
I am facing problem while setting focus in EdiText. Below is my EditText property.
I'm trying to implement a listView with EditText Controls. Problem is when I edit
Problem: I have a table that prints out vertical but I would like it
Problem: I am trying to build a recursive tree using a function and data
Problem: I'm streaming my video from a php file with stream_get_contents(); using Flowplayer as

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.