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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:42:37+00:00 2026-05-23T12:42:37+00:00

I have weird situation with EditText. Situation: set device to landscape mode enter text

  • 0

I have weird situation with EditText.
Situation:

  1. set device to landscape mode
  2. enter text to EditText and press
    “DONE”
  3. change orientation
  4. EditText contains doubled text that
    was typed

the code:

private EditText enterText;

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

    enterText = (EditText) findViewById(R.id.enterText);
}

If I comment the line with findViewById, everything is working properly.

Any ideas why this happens?

EDIT: I’ve double checked and it happens every time, not only if the line I was written about is commented.. :-\

EDIT2: It happens only on first orientation change event. Every next is OK..

  • 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-23T12:42:37+00:00Added an answer on May 23, 2026 at 12:42 pm

    Every time you rotate your phone the Activity restarts, which probably calls something that causes your text to be written again somehow. This is part of the OS and a bit annoying, here is that to do.

    If you in your manifest add:

    android:configChanges="orientation"
    

    to the activity node in which the rotation is done, you’ll have to override the onConfigurationChanged.

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
      super.onConfigurationChanged(newConfig);
      setContentView(R.layout.myLayout);
    
    }
    

    Whenever your phone rotates the overriden method will call and you can do a special initialization like ignore the input if there was an input earlier and such. Hope this gets you on the right track!

    PS: You can also pipeline the configChanges with different other “values/configs”. Such as keyboardHidden and many others.

    They are listed on the following link

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

Sidebar

Related Questions

I have a weird data model situation to start with, so maybe my whole
My situation is pretty straight forward. I have a server configured with max_allowed_packet set
I am having a weird situation where a Service that is created is stopping
So I have a very weird problem. I am writing some code in VB.Net
Situation: I have a few hundred posts each belonging to a particular category. A]
a noob question here. I have a very strange situation that's very puzzling to
I have experienced an odd behavior of the BackgroundWorker or the .NET framework when
I need a very weird thing I admit. I hope you'll be able to
I have a DataGridView that I am binding to a POCO. I have the
I'm the build engineer for a new iPhone application and I've run into the

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.