0
I was making an app and at one point came across the error Default Activity not found
. I tried to undo the changes and the error persisted . Trying to fix it I noticed that all the files .xml
project present an error in the field tools:context=
.
Androidmanifest.xml
<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"
tools:ignore="GoogleAppIndexingWarning">
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<activity android:name=".activity.RequisicoesActivity" />
<activity android:name=".activity.MapsActivity" />
<activity
android:name=".activity.CadastroActivity"
android:label="@string/title_cadastro"
android:parentActivityName=".activity.MainActivity" />
<activity
android:name=".activity.LoginActivity"
android:label="@string/title_login"
android:parentActivityName=".activity.MainActivity" />
<activity
android:name=".activity.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.MapsActivity" />
<activity
android:name=".activity.CadastroActivity"
android:label="@string/title_cadastro"
android:parentActivityName=".activity.MainActivity" />
<activity
android:name=".activity.LoginActivity"
android:label="@string/title_login"
android:parentActivityName=".activity.MainActivity" />
</application>
error persists.Agadeço the attempt
– OTAVIO ANDRADE
Do the following: Start typing in xml tools:context="." and stop and let Android Studio indicate which Activity you want to link your xml to. If android studio does not point any Activity, restart android studio by clearing the cache and do the same procedure.
– Andre Alas
Thank you my Noble. The error of the
.xml
was solved the code was like thistools:context="marcelootaviodeandrade.turbam.com.activity.MainActivity">

however Default Activity not found persists.– OTAVIO ANDRADE
Is your structure app/src/main/java/.../Activity/Mainactivity.java? Have you tried
File > Invalidate Caches / Restart
?– Lennoard Silva