在线问答(客户端打开时动画显示)
这部分代码的功能是:在打开客户端的时候,会有一个3秒时间动画显示。
package android.user;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.app.Activity;
import android.view.Menu;
/**
*
* @{#} SplashActivity.java Create on 2013-5-2
*
* class desc:
*
* <p>Copyright: Copyright(c) 2013 </p>
* @Version 1.0
* @Author <a href="mailto:gaolei_xj@163.com">Leo</a>
*
*
*/
public class SplashActivity extends Activity {
private static final long SPLASH_DELAY_MILLIS = 3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
new Handler().postDelayed(new Runnable() {
public void run() {
goHome();
}
}, SPLASH_DELAY_MILLIS);
}
private void goHome() {
Intent intent = new Intent(SplashActivity.this,Zhuce.class);
SplashActivity.this.startActivity(intent);
SplashActivity.this.finish();
}
}

浙公网安备 33010602011771号