Activity not found

Asked

Viewed 2,042 times

0

I deleted the MainActivity and created 2 Layouts.

One by the name of activity_acessar and activity_menu.

But when I run it displays the following message.

Error running app: Default Activity not found.

Androidmanifest.xml

<?xml version="1.0" encoding="utf-8"?>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name="org.view.activityAcessar" />
    <activity android:name="org.view.activityMenu"></activity>

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

</application>

1 answer

3


You need to put the intent-filter within your activity. Behold:

<activity android:name="org.view.activityAcessar">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

The <action android:name="android.intent.action.MAIN" /> is the entry point of the application, that is, when you launch the application, this activity is created.

You can see more details in the documentation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.