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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:27:19+00:00 2026-06-11T03:27:19+00:00

I have a layout that has an EditText and a Button. I <include> it

  • 0

I have a layout that has an EditText and a Button. I <include> it in my main layout.

I’m having a weird issue with the layout and rotation. It seems to duplicate itself when the device (physical) is rotated, messing up the text and layout.

Here it is on first open, after I add some extra garble:

1

DSC_0013 is in the EditText on launch of the fragment.

Then, I rotate the phone and add some different garble:

2

And you can see the issue pretty clearly. At first, I thought it was just the EditText messing up. But if I add enough text to make a new line:

3

I can see that the button gets messed up too.

I do override onSaveInstanceState, but in it I don’t touch the EditText or its value, it’s strictly used for something else.

What’s happening and how do I fix it?

  • 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-11T03:27:20+00:00Added an answer on June 11, 2026 at 3:27 am

    Fixed it!

    Turns out it wasn’t the view duplicating itself, or the EditText, or the Button. It was the entire fragment.

    In my Activity’s onCreate, I add the fragment to an xml layout:

    private FileDetails fileDetailsFragment;
    
    public void onCreate(Bundle savedInstanceState) {
            ...
            FragmentManager fragmentManager = getSupportFragmentManager();
            FragmentTransaction fragmentTransaction = fragmentManager
                    .beginTransaction();
            fileDetailsFragment = new FileDetails(fileData);
            fragmentTransaction.add(R.id.DetailsHolder, fileDetailsFragment);
            fragmentTransaction.commit();
    

    And onCreate was being called every time I rotated the phone (as it’s meant to). So I put in a check to see if the activity is being run for the first time, and it works great.

    private FileDetails fileDetailsFragment;
    
    public void onCreate(Bundle savedInstanceState) {
        ...
        if (savedInstanceState == null) {
            FragmentManager fragmentManager = getSupportFragmentManager();
            FragmentTransaction fragmentTransaction = fragmentManager
                    .beginTransaction();
            fileDetailsFragment = new FileDetails(fileData);
            fragmentTransaction.add(R.id.DetailsHolder, fileDetailsFragment);
            fragmentTransaction.commit();
        } else {
            fileDetailsFragment = (FileDetails) getSupportFragmentManager().findFragmentById(R.id.DetailsHolder);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Linear Layout that has a Button and a TextView on it.
In main.xml, I have a table layout that it has two buttons in the
I have a simple login layout that contains two EditText fields and a Button
Hy, I have a layout in the views/layout that has 2 cols and then
I have a two column site layout that has the content of the left
I have been able to design my layout so that it has 2 columns
I have an ExtJS Viewport with a container that has the border layout and
I have a layout which has one large EditText view at the top +
I have the following app that has a textview and an edittext. When the
If you have a layout that has in a menu which gets its menu

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.