Unable to find explicit activity class in android

I have an android project with several packages. The structure of the packages in this case is com.siva.restorative is the package that contains the activity I want to run.

My activities are declared in my manifest as

 <activity android:theme="@style/YtdTheme" android:name="com.siva.restorativecare.RestorativeCare">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

The mainScreen activity displays fine, since it is inside the com.WAPP package. But when I try to run the setLocationActivity, I get the unable to find explicit class error. Here is how I have the intent parameters:

Intent i = new Intent(this,SecondActivity.class);

1 Answer

  1. Bruce- Reply

    2019-11-16

    I guess first you should change the action string in manifest as:

    <action android:name="com.siva.restorativecare.RestorativeCare" />
    

    and then start running your activity as:

    Intent i = new Intent("com.siva.restorativecare.RestorativeCare");
    startActivity(i);
    

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>