Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Android:Splash screen doesnt fade away

Options
  • 27-06-2013 5:24pm
    #1
    Registered Users Posts: 5,542 ✭✭✭


    Hi folks, see below. The code doesnt cause splash screen to move onto the main program on my app. Can you advise what may be awol?



    package com.example.rays;
    import android.app.Activity;
    import android.content.Context;
    import android.content.Intent;
    import android.os.Bundle;
    import android.os.Handler;

    public class Splash extends Activity {
    private static final int SPLASH_TIME = 2 * 1000;// 3 seconds
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fullscreen);

    try {
    new Handler().postDelayed(new Runnable() {
    public void run() {
    final Context context = Splash.this;

    Intent intent = new Intent(Splash.this, Splash.class); //Maybe....



    startActivity(intent);
    Splash.this.finish();
    overridePendingTransition(R.anim.fadein, R.anim.fadeout);
    }
    }, SPLASH_TIME);
    new Handler().postDelayed(new Runnable() {
    public void run() {
    }
    }, SPLASH_TIME);
    } catch(Exception e){}
    }
    @Override
    public void onBackPressed() {
    this.finish();
    super.onBackPressed();
    }
    }


Comments

Advertisement