Android标题栏和图标

时间:2014-12-23 15:11:40

标签: android user-interface styles

当我的应用程序启动时,我会看到标题栏和带有白色活动的应用程序名称。 尽管我的主要活动是启动画面,但它最初不会启动,而是在此标题栏和白色活动的2秒后启动。我如何禁用此功能。

感谢您的帮助!

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();
    }

}
`

清单文件

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

1 个答案:

答案 0 :(得分:0)

删除主要活动的主题

机器人:主题= “Theme.Holo.NoActionBar”