스플래시 화면을 표시하는 앱이 있습니다. 시작 화면의 활동은 단순히 1 초 동안 자고 새의 Runnable를 만든 다음 주요 활동 시작 :UI 스레드와 다른 스레드 간의 차이점
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
UKMPGDataProvider.init(this.getApplicationContext(), Constants.DATABASE_NAME);
Thread splashThread = new Thread() {
@Override
public void run() {
try {
sleep(ONE_SECOND_IN_MILLIS);
} catch (InterruptedException e) {
} finally {
Intent intent = new Intent(SplashScreen.this, MainScreen.class);
finish();
startActivity(intent);
}
}
};
splashThread.start();
}
인가는 확인의 주요 활동 (및 시작 화면을 제외하고, 따라서 전체 응용 프로그램)을 시작합니다 이 새로운 스레드?
Android에서 'UI 스레드'에 대해 많이 들었습니다. 이 새 스레드는 이제 UI 스레드가되거나 UI 스레드 특수한 어떤 식 으로든됩니까?
좋아요.하지만 문제는 비 UI 스레드에서 액티비티를 시작했는지 또는 이것이 일어 났는지 여부입니다. – barry