I am making an app and I am adding a splash screen and when I launch the app the default android icon shows up instead of my startup screen with splash animation. I want to resolve the problem.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.SmartExpenseTracker"
tools:targetApi="31">
<activity
android:name=".SplashActivity"
android:exported="true"
android:label="@string/title_activity_splash"
android:theme="@style/Theme.SmartExpenseTracker">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"
android:exported="false"/>
</application>
</manifest>
package com.example.smartexpensetracker
import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp
import kotlinx.coroutines.delay
@SuppressLint("CustomSplashScreen")
class SplashActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
StartUp() {
startActivity(Intent(this, MainActivity::class.java))
finish()
}
}
}
}
@Composable
fun StartUp(onTimeout: () -> Unit) {
LaunchedEffect(key1 = true) {
delay(2000)
onTimeout()
}
val acmeFont = FontFamily(
Font(R.font.acme_regular, FontWeight.Normal)
)
Column(
Modifier
.fillMaxSize()
.background(Color.Blue),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Box {
Text(
text = "Expense Tracker",
fontSize = 37.sp,
fontFamily = acmeFont,
color = Color.White
)
}
}
}
I made the necessary changes in the app manifest and tried to run then but there is no change. I even deleted the icon file but now it shows a different type of icon and I want that directly the splash screen opens and the icons should not be visible or get open
This Icon