当我运行它时,它应该绘制 ui,(两个简单的图像和一个文本静态文本字段)等待五秒钟,然后前进到下一个活动(另一个带有几个按钮的页面)
我可以让它加载图像而不是前进,或者显示一个空白页面,等待五,然后继续。
主要的java文档:
package com.example.ccbc_maps;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
public class MainActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//When I add a call to the main function here it just displays the white space
//Then advances after five seconds same thing if I paste the code within
//The main method.
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
public void main()
{
try
{
Thread.sleep(5000);
}
catch (InterruptedException e)
{
}
Intent goForward = new Intent(this, CampusSelect.class);
startActivity(goForward);
}
}
这是它前进的课程:
package com.example.ccbc_maps;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class CampusSelect extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_campus_select);
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.activity_campus_select, menu);
return true;
}
}
谢谢您的帮助!