HOW TO ADD SPLASH SCREEN ACTIVITY IN ANDROID STUDIO - Andropro

Andropro

androidtutorialro

Breaking

Home Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Monday, July 9, 2018

HOW TO ADD SPLASH SCREEN ACTIVITY IN ANDROID STUDIO

ADDING SPLASH SCREEN ACTIVITY TO ANDROID STUDIO:

this tutorial will guide you how to add an splash sceen activity in your android studio project,adding an splash screen activity in your android app will give an good feel to an user to use and it will make your app looks professional,adding an splash screen activity is simple and easy way,follow this tutorial to learn how to add splash screen activity,



SPLASH SCREEN ACTIVITY:

STEP1:  create SplashActivity.java file and
                           splashfile.xml layout


STEP 2:  


splashfile.xml:




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

<LinearLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"   
 android:layout_width="match_parent"  
  android:layout_height="match_parent" 
   xmlns:tools="http://schemas.android.com/tools"    
android:gravity="center"    
tools:context="astin.mypro.com.image.SplashActivity">


    <ImageView      
  android:id="@+id/logo_id"    
    android:layout_width="fill_parent"     
   android:layout_height="match_parent"     
   android:src="@drawable/splash3"      
  tools:ignore="ContentDescription" />




</LinearLayout>




SplashActivity.java:



public class SplashActivity extends Activity {

    Handler handler;
    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.splashfile);

        handler=new Handler();
        handler.postDelayed(new Runnable() {
            @Override            public void run() {
                Intent intent=new Intent(SplashActivity.this,MainActivity.class);
                startActivity(intent);
                finish();
            }
        },3000);

    }
}



ANDROIDMANIFESTFILE.XML:


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"    
package="astin.mypro.com.image">

    <application        
android:allowBackup="true"       
 android:icon="@mipmap/ic_launcher"    
    android:label="@string/app_name"      
  android:roundIcon="@mipmap/ic_launcher_round"       
 android:supportsRtl="true"     
   android:theme="@style/AppTheme">

        <activity android:name=".SplashActivity">

            <intent-filter>

                <action   
                 android:name="android.intent.action.MAIN" 
                   android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>
        <activity android:name="astin.mypro.com.image.MainActivity" />



    </application>


</manifest>





SPLASH SCREEN ACTIVITY:




   

Post Bottom Ad

Responsive Ads Here

Pages