When launching the application there is short time for which the logo is shown and after that my splash screen animation starts. How do I disable my logo from being shown when the application is launched. I want my splash screen to run direclty no logo should be shown.
Here's the code for my XML file:
<?xml version="1.0" encoding="utf-8"?\>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SplashScreen"
android:background="#FCFCFC"\>
<pl.droidsonroids.gif.GifImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/splash_screen"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Here's the SplashActivity file for it:
package com.example.tictactoe
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.Handler
import android.os.Looper
class SplashScreen : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_splash)
Handler(Looper.getMainLooper()).postDelayed({
val intent = Intent(this , MainActivity::class.java)
startActivity(intent)
finish()
},2200)
}
}
Here's the manifest:
<?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:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.TicTacToe"
tools:targetApi="31">
<activity
android:name=".SplashScreen"
android:exported="true"
android:screenOrientation="portrait">
<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="true"
android:screenOrientation="portrait">
</activity>
</application>
</manifest>
Is it because the system takes some time to load the resource, so in the meantime, it displays the logo and then begins the animation.
Basically which you saying logo its default type splash for android 12 and above, to disable that default view you can check official website android, you will get all implementation about that topic...