大家好,我只想让程序显示布局 main0 并停留几秒,然后显示布局 main1,就像我们在任何手机中看到的程序一样,在程序开始时显示图像或布局,然后淡出。
/**the main activity */
public class rdwt extends Activity implements OnClickListener{
Button b1;
Button b2;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main0);
//Here
setContentView(R.layout.main1);
b1= (Button)findViewById(R.id.Button01);
b2= (Button)findViewById(R.id.Button02);
b1.setOnClickListener(this);
b2.setOnClickListener(this);
}
public void onClick(View v) {
if (v==this.b1){
Intent callwrite = new Intent(this, wto.class);
startActivity(callwrite);
}
if(v==this.b2){
Intent callread = new Intent(this, rfr.class);
startActivity(callread);
}
}
最佳答案
您需要阅读有关 Updating the UI from a Timer 的技术文章
关于android - 如何让 android 程序显示布局,然后等待几秒钟。并显示另一种布局?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3321818/