splashactivity

 create

new activity

splash java

package com.books.darsenizami;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import java.time.Instant;

public class splashactivity extends AppCompatActivity {

private static int splash_time = 4000;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splashactivity);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(splashactivity.this,MainActivity.class);
startActivity(intent);




splash xmal

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#31DAFF"
tools:context=".splashactivity">
<ImageView
android:layout_width="wrap_content"
android:src="@drawable/samina"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:id="@+id/samina"

/>



</RelativeLayout>




Leave a Comment