java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.sunshine/com.example.android.sunshine.MainActivity}: java.lang.ClassCastException: com.example.android.sunshine.ForecastFragment$FetchWeatherTask cannot be cast to java.util.List

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,

Create an empty public constructor in your code.

Solutions on the web

via Stack Overflow by Vivek
, 1 year ago
Unable to start activity ComponentInfo{com.example.android.sunshine/com.example.android.sunshine.MainActivity}: java.lang.ClassCastException: com.example.android.sunshine.ForecastFragment$FetchWeatherTask cannot be cast to java.util.List
via Stack Overflow by ashok
, 3 months ago
Unable to start activity ComponentInfo{com.example.bptc/com.example.bptc.MainActivity}: java.lang.ClassCastException: com.example.bptc.MainActivity$AsyncTaskRunner cannot be cast to java.util.List
via Stack Overflow by J. Doe
, 6 months ago
Unable to start activity ComponentInfo{com.example.android.sunshine/com.example.android.sunshine.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ProgressBar.setVisibility(int)' on a null object reference
via Stack Overflow by DanikPonik
, 1 year ago
Unable to start activity ComponentInfo{com.example.android.sunshine/com.example.android.sunshine.MainActivity}: android.view.InflateException: Binary XML file line #24: Binary XML file line #1: Error inflating class fragment
via GitHub by mathieudevos
, 1 year ago
Unable to start activity ComponentInfo{com.mattikettu.pinkiponki/com.mattikettu.pinkiponki.RegisterActivity}: java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView cannot be cast to android.app.Activity
via GitHub by jonandersen
, 7 months ago
Unable to start activity ComponentInfo{co.and.andco.development/co.and.andco.SplashActivity}: java.lang.ClassCastException: android.app.TaskStackBuilder cannot be cast to android.content.Intent
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.sunshine/com.example.android.sunshine.MainActivity}: java.lang.ClassCastException: com.example.android.sunshine.ForecastFragment$FetchWeatherTask cannot be cast to java.util.List
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)

Users with the same issue

66 times, 3 weeks ago
Once, 2 months ago
33 times, 3 months ago
8 times, 3 months ago
468 times, 4 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.