haijiang
2018-07-10 e48c183a0984908c14eebd9791761d13d9baca2c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.moral.screen.activity;
 
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
 
import com.moral.screen.MainApp;
import com.moral.screen.R;
 
 
public class SplashActivity extends Activity implements Runnable {
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ac_splash);
 
        Thread delayThread = new Thread(this);
        delayThread.start();
    }
 
    @Override
    public void run() {
        try {
            Thread.sleep(1000);
        } catch(InterruptedException e) {
            e.printStackTrace();
        }
        if(MainApp.theApp.orgId==0){
            Intent intent = new Intent(this, LoginActivity.class);
            startActivity(intent);
        }else{
            Intent intent = new Intent(this, MapActivity.class);
            startActivity(intent);
        }
        finish();
    }
}