Android相当于iPhone的默认图像

时间:2011-06-06 14:45:35

标签: android default splash-screen

是否可以在启动应用程序期间设置默认图像?在iPhone上,我可以设置一个名为“Default.png”的图像来做到这一点。但是在Android上有可能吗?

(有关我要求的信息,因为我不能使用splascreen视图或自动活动到另一个,因为第一个活动中的videoview。)

1 个答案:

答案 0 :(得分:0)

我不明白为什么不使用启动画面

public class SplashScreenActivity extends Activity {
    protected boolean _active = true;
    private Thread splashTread;
    protected int _splashTime = 2000; // time to display the splash screen in ms

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);
        // thread for displaying the SplashScreen
        final SplashScreenActivity sPlashScreen = this;
        // thread for displaying the SplashScreen
        splashTread = new Thread() {
            @Override
            public void run() {
                try {
                    synchronized (this) {
                        // wait 5 sec
                        wait(_splashTime);
                    }
                } catch (InterruptedException e) {

                } catch (UnsupportedOperationException e1) {
                    // TODO: handle exception
                } finally {
                    finish();
                    // start a new activity
                    Intent i = new Intent();
                    i.setClass(sPlashScreen, Your videoViewActivity.class);
                    startActivity(i);
                }
            }
        };
        splashTread.start();
    }

    // Function that will handle the touch
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            synchronized (splashTread) {
                splashTread.notifyAll();
            }
        }
        return true;
    }
}