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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:07:34+00:00 2026-05-27T03:07:34+00:00

I use a view which has RelativeLayout -> ScrollView -> LinearLayout. I get exception:

  • 0

I use a view which has RelativeLayout -> ScrollView -> LinearLayout. I get exception:

11-22 11:17:24.605: ERROR/AndroidRuntime(5161): FATAL EXCEPTION: main
11-22 11:17:24.605: ERROR/AndroidRuntime(5161): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3131)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at android.view.View.measure(View.java:8172)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at android.view.ViewRoot.performTraversals(ViewRoot.java:805)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at android.os.Looper.loop(Looper.java:144)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at android.app.ActivityThread.main(ActivityThread.java:4937)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at java.lang.reflect.Method.invokeNative(Native Method)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at java.lang.reflect.Method.invoke(Method.java:521)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-22 11:17:24.605: ERROR/AndroidRuntime(5161):     at dalvik.system.NativeStart.main(Native Method)

Why does it happen only occassionally? Why is there no detail of where the code failed?

Update: I suspect it should fail around this code:

EditText input = new EditText(context);
input.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

LayoutParams is RelativeLayout.LayoutParams

  • 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-27T03:07:34+00:00Added an answer on May 27, 2026 at 3:07 am

    Use new LinearLayout.LayoutParams(...) instead of new LayoutParams(...)

    You always need to use the parent layout’s class for the LayoutParams. E.g. if EditText is inside FrameLayout then FrameLayout.LayoutParams must be used.

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

Sidebar

Related Questions

I've got a view function that has to decide which form to use depending
I have a main View that has a table which has it's own controller.
I have a job model which has many attributes. I would like to use
i have a scroll view which represents a map, it has pins on it,
I'm attempting to use the Super Inplace Controls plugin, which has an in_place_select method.
I have a scroll view which has some controls like textField and textArea on
I have a nice clean UI within a table view which has a few
I have been trying to write a delegate to a view controller which has
we have a view in our database which has an ORDER BY in it.
I have a map view which has overlay items on top of them. 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.