-2

When my app starts up i see the title bar and the application name with a white activity. Even though my mainactivity is a splash screen, it does not start at first, but after 2 seconds of this Title bar and white activity. How do i disable this.

thanks for the help!

Splash.java

`public class Splash extends Activity {

    @Override
    protected void onCreate(Bundle parameter) {
        // TODO Auto-generated method stub
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.splash);
        super.onCreate(parameter);
        Thread timer= new Thread()
        {
            @Override
            public void run()
            {
                try
                {
                    //Display for 3 seconds
                    sleep(3000);
                }
                catch (InterruptedException e) 
                {
                    // TODO: handle exception
                    e.printStackTrace();
                }
                finally
                {   
                    //Goes to Activity  StartingPoint.java(STARTINGPOINT)
                    Intent openstartingpoint=new Intent("com.vault.beta.MAINACTIVITY");
                    startActivity(openstartingpoint);
                }
            }
        };
        timer.start();
    }

    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
        finish();
    }

}
`

Manifest file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.vault.beta"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="21" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".Splash"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity"
            android:label="Vault - Login" >
            <intent-filter>
                <action android:name="com.vault.beta.MAINACTIVITY" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
         <activity
            android:name=".Screen"
            android:label="Calender" >
            <intent-filter>
                <action android:name="com.vault.beta.SCREEN" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MenuList"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.vault.beta.MENULIST" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Password"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.vault.beta.PASSWORD" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
         <activity
            android:name=".EditNote"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.vault.beta.EDITNOTE" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>

</manifest>
Pavan Kumar
  • 157
  • 2
  • 4
  • 17
  • Probably you are declaring another activity in your manifest. Could you copy/paste the manifest file? – Trebia Project. Dec 23 '14 at 15:14
  • possible duplicate of [How do I make a splash screen in android](http://stackoverflow.com/questions/5486789/how-do-i-make-a-splash-screen-in-android#15832037) – ben75 Dec 23 '14 at 15:22
  • @ben75 the question is not about creating the splash screen. pls read the question before voting down. My problem is, the splash screen activity being the Launcher activity is preceded by a blank body with the title bar, app icon and app name. – Pavan Kumar Dec 23 '14 at 15:31
  • First activity that runs is Splash. What you mention is that splash activity runs but afterwards another layout appears, is that correct? – Trebia Project. Dec 23 '14 at 15:34
  • No, a blank activity with Title bar, icon and app name runs BEFORE splash activity. for about 3 seconds @TrebiaProject. – Pavan Kumar Dec 23 '14 at 15:41
  • How many times are you calling setContentView() in yout Splash activity? – Trebia Project. Dec 23 '14 at 15:46
  • only once, in a loop after the time is elapsed. – Pavan Kumar Dec 23 '14 at 15:56
  • Um... can you call it at the very beginning? – Trebia Project. Dec 23 '14 at 15:58
  • tried that , but same result. there is one more app where in it does not have a splash screen. But main activity is delayed. – Pavan Kumar Dec 23 '14 at 15:59
  • @PavanKumar I didn't downvote (but vote to close). The duplicate that I suggest is explaining how to avoid what you call "*blank body with the title bar, app icon and app name*" and it is what you are asking no ? – ben75 Dec 23 '14 at 20:41
  • Possibly you're doing some UI thread blocking in your splash activity `onCreate()` so that only the theme background gets displayed. Post the code there. – laalto Dec 23 '14 at 20:46
  • @laalto posted the splashscreen code. – Pavan Kumar Dec 24 '14 at 05:09
  • hum... this is not code for a *splashscreen*, this is code for an Activity with an ImageView – ben75 Dec 24 '14 at 06:56
  • is it? ok ben! ill refer to the link u pasted here. – Pavan Kumar Dec 24 '14 at 14:11

1 Answers1

0

Remove the theme of the main activity

android:theme="Theme.Holo.NoActionBar"