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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:46:10+00:00 2026-05-19T17:46:10+00:00

I’m making a Live Wallpaper and attempting to add some user preferences. If I

  • 0

I’m making a Live Wallpaper and attempting to add some user preferences. If I have this:

public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
    drawType = prefs.getString("drawtype", "0");
}

I get a ClassCastException upon running the app on a completely unrelated line:

Line front = (Line) polyList.get(polyList.size()-1);

If I comment out the line beginning with “drawType =” I get no exceptions and the app works fine (albeit without the user settings doing anything).

Can anybody explain this at all, it doesn’t seem to make any sense. If you need more parts of my code I’m happy to provide them. Thanks.

EDIT: Not sure how to get a stack trace, so at the risk of being unhelpful, here is my logcat:

02-01 21:45:26.934: ERROR/AndroidRuntime(4264): FATAL EXCEPTION: main
02-01 21:45:26.934: ERROR/AndroidRuntime(4264): java.lang.ClassCastException: com.nickavv.linear.Line
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.nickavv.linear.Wallpaper.draw(Wallpaper.java:127)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.nickavv.linear.Wallpaper$WallEngine.drawFrame(Wallpaper.java:95)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.nickavv.linear.Wallbaser$AnimationEngine.onSurfaceChanged(Wallbaser.java:45)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:558)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.service.wallpaper.WallpaperService$Engine.attach(WallpaperService.java:606)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:817)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.os.Looper.loop(Looper.java:123)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.app.ActivityThread.main(ActivityThread.java:4627)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at java.lang.reflect.Method.invokeNative(Native Method)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at java.lang.reflect.Method.invoke(Method.java:521)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at dalvik.system.NativeStart.main(Native Method)
  • 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-19T17:46:11+00:00Added an answer on May 19, 2026 at 5:46 pm

    My roommate and I took a fresh look over the code and “played computer” as it were. We solved it by the fact that my ArrayList wasn’t being cleared of the old “Line”s before attempting to fill it with “Triangle”s, thus the casting error. I feel both stupid and relieved at the same time, as it always it. Thanks for all the help everyone.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't

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.