Skip to content Skip to sidebar Skip to footer

Why This Runtime Is Occured :unable To Instantiate Activity Componentinfo?

when I try to define an spinner, this Run time exception is thrown. Why?

Solution 1:

You have to initialize your spinner in the onCreate method, so move

CARS_TYPE = (Spinner)findViewById(...);

inside onCreate() after setContentView

one more thing, CARS_TYPE should not be a constant, better if you call it carsType instead

Post a Comment for "Why This Runtime Is Occured :unable To Instantiate Activity Componentinfo?"