Ogni volta che la mia app si avvia, c'è uno sfondo bianco visualizzato in breve tempo. Nonostante l'utilizzo della schermata iniziale, il problema esiste ancora. Vorrei impostare lo schermo di avvio su nero invece che bianco come predefinito!Sfondo bianco all'avvio dell'app Android
Questa è l'attività dello schermo del mio iniziale:
public class SplashActivity extends Activity {
private static String TAG = SplashActivity.class.getName();
private static long SLEEP_TIME = 1; // Sleep for some time
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE); // Removes title bar
setContentView(R.layout.splash);
// Start timer and launch main activity
IntentLauncher launcher = new IntentLauncher();
launcher.start();
}
private class IntentLauncher extends Thread {
/**
* Sleep for some time and than start new activity.
*/
@Override
public void run() {
try {
// Sleeping
Thread.sleep(SLEEP_TIME*1000);
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
// Start main activity
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
SplashActivity.this.startActivity(intent);
SplashActivity.this.finish();
}
}
@Override
protected void onPause() {
super.onPause();
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
}
Grazie! Quello è buono! – cxphong
molto bello - grazie! – gnB