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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:42:06+00:00 2026-05-12T13:42:06+00:00

Using Android, here is part of a layout xml file: <LinearLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical

  • 0

Using Android, here is part of a layout xml file:

<LinearLayout
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:orientation="vertical"
   android:textColor="#191919">

      <TextView android:id="@+id/someTextField"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1" 
          android:textStyle="bold" />

      <TextView android:id="@+id/anotherTextField"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1" />

</LinearLayout>

I am adding this view (at runtime) to a ViewAnimator like this:

ViewAnimator viewAnimator = (ViewAnimator)findViewById(R.id.viewAnimator);
View newView = View.inflate(this, R.layout.new_view, null);
viewAnimator.addView(newView);
viewAnimator.showNext();

String newValue = "new value for the text field";
findViewById(R.id.deal_view).setVisibility(View.VISIBLE);
TextView someTextField = (TextView)findViewById(R.id.someTextField);
someTextField.setText(newValue); 

This seems to be working fine, but when newValue is long enough to take more than 1 line of text in the layout, I am getting a crash:

09-06 21:36:48.208: ERROR/AndroidRuntime(6561): Uncaught handler: thread main exiting due to uncaught exception
09-06 21:36:48.248: ERROR/AndroidRuntime(6561): java.lang.StackOverflowError
09-06 21:36:48.248: ERROR/AndroidRuntime(6561):     at android.view.ViewGroup.drawChild(ViewGroup.java:1486)
09-06 21:36:48.248: ERROR/AndroidRuntime(6561):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
(many more lines like this)

Is this enough information to see what I might be doing wrong? It works perfectly fine when newValue is short enough for one line. I’ve thought about trying a TableLayout but it seems like this is exactly what a LinearLayout is good for.

  • 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-12T13:42:06+00:00Added an answer on May 12, 2026 at 1:42 pm

    Thanks for the help in the comments. I ended up taking the advice here (dropping ViewAnimator directly and using ViewFlipper). Better app, but still the same problem. I dropped one level of LinearLayout containers and it started working fine.

    I’m assuming bhatt4982 is right, UI depth was too great.

    bhatt4982, post your comment as an answer to get credit for this.

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

Sidebar

Ask A Question

Stats

  • Questions 227k
  • Answers 227k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Jim, I've made a user control and given is a… May 13, 2026 at 1:23 am
  • Editorial Team
    Editorial Team added an answer This is going to be a very opinionated answer section.… May 13, 2026 at 1:23 am
  • Editorial Team
    Editorial Team added an answer When you delete an item from a collection in Access… May 13, 2026 at 1:23 am

Related Questions

I'm trying to perform a Median filter on an image in Java but it's
So far I've a class for a simple local service. What I want to
I'm trying to replicate some image filtering software on the Android platform. The desktop
I want to make a tile based game for android. At the moment I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.