This is for a splash screen. I’ve followed the tutorial but it’s still not working. It keeps on getting an error.
This is my code:
package id.ac.umn.finalproject;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent startApp = new Intent(MainActivity.this, PemasukanActivity.class);
new Handler().postDelayed(startActivity(startApp), 3000);
}
}
2
Answers
In Kotlin try this:
The correct way to create a Splash screen is as follows
style.xml
Splash.xml
Manifest
SplashActivity.java