Android error unable to find explicit activity class

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();

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));

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

If the new activity not in the same packet with MainActivity(you call from here?), try declare on manifest

<activity android_name=com.WAPP.SetLocation.setLocationActivity></activity>

and in the caller

Intent intent = new Intent(this, setLocationActivity.class);

Hope this helps!

Android error unable to find explicit activity class

In additional to the above answers make sure that your activities are declared inside application in manifest

    [email protected]/app_name

    <activity android_name=.mainScreenActivity></activity>
    <activity android_name=.SetLocation.setLocationActivity></activity>


Leave a Reply

Your email address will not be published.