当我的应用程序启动时,我看到标题栏和带有白色活动的应用程序名称。尽管我的主要活动是初始屏幕,但它一开始不会开始,而是在此标题栏和白色活动 2 秒后启动。如何禁用此功能。
感谢您的帮助!
飞溅.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>
删除主活动的主题
android:theme="Theme.Holo.NoActionBar">