它在"startActivity(i);"
中顯示錯誤。startActivity(i);顯示錯誤
Error: startActivity (android.content.Intent) in Activity cannot be applied.
這裏是代碼:
public class LoadingScreen extends AppCompatActivity {
private static int SplashInterval = 2000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.loading_screen);
new Handler().postDelayed(new Runnable(){
@Override
public void run(){
//TODO Auto-generated method stub
Intent i = new Intent(LoadingScreen.this, MainActivity.class);
startActivity(i);
this.finish();
}
private void finish(){
//TODO Auto-generated method stub
}
},SplashInterval);
};
}
我想你忘了問這個問題:p – Nathan
paste LoadingScreen.this.finish();而不是this.finish(); –