我想切换到新的活动(触摸屏幕时)或(5秒后)。这是我正在使用的代码
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
new Handler().postDelayed(new Runnable() { @Override public void run() { Intent intent = new Intent(MainActivity.this, SecondActivity.class); startActivity(intent); } }, 5000);
}