I get the following error:
android.content.ActivityNotFoundException: Unable to find explicit activity class {montsemkd.eac1_activity/montsemkd.eac1_activity.Acitivty2}; have you declared this activity in your AndroidManifest.xml?
I am testing something as simple as moving from one Activity to another through a button.
Mi manifest es el siguiente:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="montsemkd.eac1_activity">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Can you help me understand what I have to put in the manifest to avoid problems?
The main class is MainActivity with its interface: activity_main.
And the second screen is Activity2 with its interface: screen2
Thanks a lot!!
It is not a problem that you declare different layout in each Activity
But check the name, actually your Activity is called
Acitivty2
and notActivity2
.You must declare the Activities that are used in your application within your file
AndroidManifest.xml
, in this case you must declare the name activityAcitivty2
inside the AndroidManifest.xml file
Review the document Declare the activity in the manifest