[Solved] why this runtime is occured :Unable to instantiate activity ComponentInfo?

[ad_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 0 [ad_2] solved why this runtime is occured :Unable to instantiate activity ComponentInfo?

[Solved] Compile single .java file with two classes into two .class files [closed]

[ad_1] I am not sure what you are doing wrong so I will just show you how it can be done. Lets say you have directories and files [myProject] | +–[src] | | | +–[com] | | | +–[DatingService] | | | +– Main.java | +–[classes] and your Main.java file looks something like package com.DatingService; … Read more