Android, el controlador se está ejecutando en el hilo principal u otro hilo?
Tengo el siguiente código.
public class SplashScreen extends Activity {
private int _splashTime = 5000;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
new Handler().postDelayed(new Thread(){
@Override
public void run(){
Intent mainMenu = new Intent(SplashScreen.this, MainMenu.class);
SplashScreen.this.startActivity(mainMenu);
SplashScreen.this.finish();
overridePendingTransition(R.drawable.fadein, R.drawable.fadeout);
}
}, _splashTime);
}
}
Tengo problema en analizar este código. En cuanto a saber manejador se está ejecutando en el hilo principal. pero tiene hilo que se ejecuta en otro hilo.
MainMenu.class ¿Se ejecutará en el hilo principal o segundo hilo? si principalhilo Se detiene durante 5 segundos el ANR se elevará. ¿Por qué cuando lo detengo con retraso?(_splashTime)
ANR no se muestra (aunque lo aumente a más de 5 segundos)