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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:27:18+00:00 2026-05-31T13:27:18+00:00

I have a LinearLayout that I am extending and I want to add a

  • 0

I have a LinearLayout that I am extending and I want to add a ViewFlipper and Views in it dynamically. Can anyone tell me why this is showing a blank screen?

protected void onLayout(boolean changed, int l, int t, int r, int b) 
{
    ViewFlipper vf = new ViewFlipper(context);      
    vf.layout(l, t, r, b);
    this.addView(vf);                       

    TextView tv = new TextView(context);
    tv.setText("FOO");
    tv.setBackgroundColor(Color.WHITE);

    vf.addView(tv, 0, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

}

  • 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-31T13:27:19+00:00Added an answer on May 31, 2026 at 1:27 pm

    Have you overriden the onMeasure() method? I think you need to do this otherwise the View is not correctly sized. Someone please correct me if I am wrong

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

Sidebar

Related Questions

I have a LinearLayout view that already contains several elements. I want to add
I have LinearLayout that has 1) Views on it and 2) has a Gesture
I have a custom view, extending LinearLayout and im trying to add some custom
I have LinearLayout in my xml file that I am trying to add a
I have a LinearLayout view that I am trying to add a divider to
I have CustomAdapter extending ArrayAdapter, in which I set some views inside LinearLayout -
I have a LinearLayout that I do larger than the screen. I want to
Hi I have a linearlayout and it seems that when I add a second
I have a code that should get a LinearLayout (with more LinearLayout's inside), and
There is one image on LinearLayout. I have to move that image in any

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.