Android error “unable to find explicit activity class”

The first parameter is application package not the package where the activity is.

You can invoke the Activity like this.

Intent i = new Intent();
i.setClassName("com.WAPP",
               "com.WAPP.SetLocation.setLocationActivity");
startActivity(i);

It is preferred as SYLARRR suggested to have Android automatically figure that out for you. Hence the call as..

startActivity(new Intent(this, setLocationActivity.class));

It’s recommended per java standards to have the package name all lower-cased and the class name as CamelCased.

Leave a Comment