Make Welcome Screen on Android Apps from Android Studio

Welcome or Splash Screen

Make Stylish Welcome Screen of Ur Android Apps from Google's Android Studio Application / Software.

How To

>> Create New Activity.
>> Go to Apps and Right Click And Create Empty Activity
>> Create New Variable in New Created Activity Class.
private static int SPLASH_TIME_OUT = 4000;
= 4000 = 4 second Time, you Can Change it.
>>
new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent homeIntent = new Intent (MainActivity.this, Main2Activity.class);
                startActivity(homeIntent);
                finish();
                overridePendingTransition(0,0);
            }
        } , SPLASH_TIME_OUT);

>> Paste This Code in SaveInstanceStats Section.

==================================================

package com.example.thekroyaardringtone;

import androidx.appcompat.app.AppCompatActivity;

import android.app.DownloadManager;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.DownloadListener;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebStorage;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;

import static android.view.View.GONE;

public class MainActivity extends AppCompatActivity {

    private static int SPLASH_TIME_OUT = 4000;


    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        new Handler().postDelayed(new Runnable() {
            @Override            public void run() {
                Intent homeIntent = new Intent (MainActivity.this, Main2Activity.class);
                startActivity(homeIntent);
                finish();
                overridePendingTransition(0,0);
            }

        } , SPLASH_TIME_OUT);

    }

    public void onBackPressed() {
            super.onBackPressed();
        }

}

==================================================



No comments:

Post a Comment