Arci
Arci

Reputation: 6819

Android has default splash screen? How do I modify it?

It seems that Android has a default splash screen. I didn't make any splash screen but every time I open my application, a splash screen appears. The title bar of my splash screen contains a string which is the name of my application. It also uses the same background as what I've set on my application.

Why does my application shows a splash screen? Is this a default on Android? I checked other applications developed by others and it doesn't have a splash screen.

How do I remove the string on the title bar of my splash screen? How can I change the background of my splash screen without affecting the background of my other activities?

Sample code of my first activity:

public void onCreate(Bundle savedInstanceState)
{
    super.onCreate();
    setContentView(R.layout.main);
    //initialize variables
    txtView1 = (TextView)this.findViewById(R.id.txtView1);
    txtView2 = (TextView)this.findViewById(R.id.txtView2);
    ...
    //register broadcast receiver
    ...
}

public void onResume()
{
    super.onResume();
    //read bundle if a bundle exists
    ...
}

Upvotes: 1

Views: 1266

Answers (2)

skynet
skynet

Reputation: 9908

The way you describe it sounds like your activity's onCreate method is taking a long time to run. Make sure you don't perform long-running operations directly on the UI thread.

Database operations, network operations, and computationally intensive operations should be done in a separate thread. See this page for android threading options.

Upvotes: 1

CommonsWare
CommonsWare

Reputation: 1007296

I didn't make any splash screen but every time I open my application, a splash screen appears.

Android does not add a splash screen to applications.

The title bar of my splash screen contains a string which is the name of my application. It also uses the same background as what I've set on my application.

This is one of your activities. Specifically, it is the one which has the following <intent-filter> in the manifest:

        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

Why does my application shows a splash screen?

Because that is what you wrote. Whatever activity you have tied to the MAIN/LAUNCHER <intent-filter> is causing this effect. You need to read your manifest file, identify this activity, take a look at the activity code, and determine what it is that you wrote.

Is this a default on Android?

No.

Upvotes: 3

Related Questions