Remove the logo that is displayed when application is launched before the splash screen begins

123 Views Asked by At

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.

3

There are 3 best solutions below

1
waseem akram On

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...

https://developer.android.com/develop/ui/views/launch/splash-screen 
0
Prabin Kumar Sahu On

As of Android 12 and higher, Android provides its splash screen. While you have the option to customize the default splash screen according to your needs, it's not possible to disable it entirely. Given that you don't have any specific logic in your splash screen, I suggest utilizing the default one. For a more detailed understanding, please refer to this link.

1
Rohit Verma On

Refer to this Android 12 splash screen and yes that logo will always be shown as it loads the resources in the meantime. if you want to get rid of that animate the logo itself.