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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:45:49+00:00 2026-06-11T21:45:49+00:00

now i get some logs like below (log-1) java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to

  • 0

now i get some logs like below (log-1)

java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to ClassA$1
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1010)
...

line 1010

final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) obj.method();//line 1010

I think ,the log should be like this (log-2)

java.lang.ClassCastException: ClassA$1 cannot be cast to android.widget.LinearLayout$LayoutParams

I wannna know that why do i get log-1,is it right?
If log-1 is right,then how can i write code to create an exception like that?

ps:I know that ClassA$1 is an anonymous class.
ps:I get this log in a monkey test,and it’s vrey hard to reappear

someone tell me :

MyInterface my = ClassA$1;//$1 is an anonymous class which implements MyInterface
my.getClass().cast(lp);

then the log will be like log-1
but why the log did not point out the “cast” method line?
and i check the folder frameworks/base/core,no one call the method “? java.lang.Class.cast(Object obj)”
any ideas?

  • 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-11T21:45:50+00:00Added an answer on June 11, 2026 at 9:45 pm

    I cannot think of a logical explanation for that behaviour. If the facts are as you report them, then I agree that error message text is the wrong way around.

    So what are the alternatives?

    • You could be misreading the log files.
    • You could be looking at the wrong version of the source code.
    • You could have found a bug … though that seems unlikely for something as fundamental as this. (In theory, the bug could be an incorrect error message coming from the VM, an incorrect line number in the stacktrace, or even a compiler bug that is cause it to do the wrong type cast.)
    • It is even possible that the exception stacktrace is a fake … though that explanation borders on paranoia.

    My suggestions are:

    • Try running the code under a debugger, and single stepping through that section of the code to confirm your belief about the cause and source of the exception.
    • Create an SSCE for this behaviour and see if other people can reproduce it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i get some Color Value like #FF6100. now i was need Covert #FF6100 to
I am having a QListView which contains some items. Now I want to get
I would like to have a shell script that copies some logs from a
Here is the scenario, User Logs In User gets up, goes to get some
since i migrated to rails 3.0, logs are now filled with queries like this:
private void getSelectedTime(final String json){ Calendar now = Calendar.getInstance(); int year = now.get(Calendar.YEAR); int
I deployed a resource adapter (XADisk) in jboss 7.1.0.final and now get an exception
How can I generate an episode with maven? I now get an error message:
Ive been trying for a while now to get a rich textbox to populate
I have been trying to days now to get this website completed ... however,

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.