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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Android:Splash screen doesnt fade away

  • 27-06-2013 4:24pm
    #1
    Registered Users, Registered Users 2 Posts: 5,658 ✭✭✭


    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

  • Moderators, Society & Culture Moderators Posts: 17,643 Mod ✭✭✭✭Graham


    Might be worth asking if your post can be moved to the Mobile Application Dev forum http://www.boards.ie/vbulletin/forumdisplay.php?f=1277


  • Registered Users, Registered Users 2 Posts: 18,272 ✭✭✭✭Atomic Pineapple


    Your intent is for the same class/Activity
    Intent intent = new Intent(Splash.this, Splash.class);
    

    Should be
    Intent intent = new Intent(Splash.this, SomeOtherActivity.class);
    


Advertisement