我有兩個類Splash.java和Activity2.java!我試過簡單的潑碼代碼:初始屏幕不顯示在android
public class Splash extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread thread= new Thread()
{
@Override
public void run()
{
super.run();
startActivity(new Intent(Splash.this,Trial.class));
finish();
}
};
thread.start();
}
}
在我的清單中,我也給出了條目。我的代碼沒有錯誤地運行。的R.layout.splash
代碼如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/d"
android:layout_gravity="center"/>
</LinearLayout>
謝謝!
爲什麼你開始在一個線程中的活動? – Falmarri 2010-11-02 06:27:54