androidandroid-manifestmanifestmain-activity

"Error running app: Default Activity not Found"


I'm programming an app with sqlite+JSON, but suddenly I couldn't Run it anymore, and it popped this message, here's my AndroidManifest.xml , Idk if there's something wrong with it, my main activity is called DatosActivity, I wish you could help me.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hitan.practica2_u3">

    <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name="com.example.hitan.practica2_u3.DatosActivity"
        android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

</manifest>

Solution

  • You should add category.LAUNCHER & action.MAIN .

     <activity 
           android:name="com.example.hitan.practica2_u3.DatosActivity"
           android:theme="@style/AppTheme.NoActionBar"
              >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
     </activity>