I started yesterday with developing app on Android Studio and I am not sure how to declare my activity in AndroidManifest. I read the post on Activity Declaration in AndroidManifest.xml but I am still not sure what to put for the name and label and how to find their exact names. I would really appreciate your help and thank you.
Asked
Active
Viewed 2,650 times
-2
-
Add your manifest file here. – Ratilal Chopda Jan 20 '18 at 13:40
-
please check my answer. – Ratilal Chopda Jan 20 '18 at 13:53
2 Answers
1
Try This
Read doc about Manifest file Manifest file structure
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.brianballz.a1ibsos">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".CreateAccountActivity"></activity>
<activity android:name=".LoginActivity"></activity>
</application>
</manifest>

Ratilal Chopda
- 4,162
- 4
- 18
- 31
-
Thank you! It works! May I know what I did wrong in my codes? So my problem was that there was an activity inside intent tag? How about my app name and label like was there a problem there? – Abby Layman Jan 20 '18 at 14:01
-
-
-
-
Just 1 more thing but I can set set an activity as a starting default using AndroidManifest right? There are 2 things currently on my Manifest which is CreateAccountActivity and LoginActivity but when I run the app, it does not show those 2 things but the original template. I tried deleting the origina acitivty.xml and debugging the app but it didnt work so what should I do? – Abby Layman Jan 21 '18 at 11:07
0
As per your shared image you have added activity inside of intent tag. Please out it from intent-filter tag. Please check below code also. Might be it will help.
<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="com.product.activities.SplashActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
//second activity
<activity android:name="com.product.activities.MainActivity" />
</activity>

devajay
- 399
- 4
- 12
-
-
Just 1 more thing but I can set set an activity as a starting default using AndroidManifest right? There are 2 things currently on my Manifest which is CreateAccountActivity and LoginActivity but when I run the app, it does not show those 2 things but the original template. I tried deleting the origina acitivty.xml and debugging the app but it didnt work so what should I do – Abby Layman Jan 21 '18 at 13:54