AwesomeSplash icon indicating copy to clipboard operation
AwesomeSplash copied to clipboard

Error shown Cannot start this animator on a detached view!

Open farukh9311 opened this issue 8 years ago • 10 comments

I cant start activity error shows Cannot start this animator on a detached view!

farukh9311 avatar Jul 22 '16 07:07 farukh9311

are you sure you're following the guides?

ViksaaSkool avatar Oct 09 '16 23:10 ViksaaSkool

Well I am pretty sure I'm following the guides and have the same problem (Using Nexus 6 Emulator with API Level 23). After doing some research, this seems to happen if you start an animation before the view is created.

java.lang.IllegalStateException: Cannot start this animator on a detached view! Cause: at com.viksaa.sssplash.lib.activity.AwesomeSplash.startCircularReveal(AwesomeSplash.java:134)

I'm using your latest version.

wurstnudl avatar Oct 14 '16 13:10 wurstnudl

Can you send me a gist/pastebin of your Activity that extends AwesomeSplash?

ViksaaSkool avatar Oct 20 '16 11:10 ViksaaSkool

i,m facing same error :( any solution ?

hrgdeveloper avatar Dec 25 '16 06:12 hrgdeveloper

Can you send me a gist/pastebin of your Activity that extends AwesomeSplash?

ViksaaSkool avatar Dec 25 '16 14:12 ViksaaSkool

Don't override OnCreate method.

ulrickpsp avatar Jan 25 '17 12:01 ulrickpsp

Hey , I have the same issue..Can you help me with error.. Thanks.

jagan607 avatar Oct 08 '17 21:10 jagan607

Check your Layout is attached to window or not by using rootLayout.isAttachedToWindow() method.

 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        if (rootLayout!= null) {

            if(rootLayout.isAttachedToWindow()) {
                ViewTreeObserver viewTreeObserver = drawerLayout.getViewTreeObserver();
                if (viewTreeObserver.isAlive()) {
                    viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
                        @Override
                        public void onGlobalLayout() {
                            startRevealAnimation(rootLayout);
                            rootLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
                        }
                    });
                }
            }
        }

CHRehan avatar Apr 04 '18 07:04 CHRehan

@abhijeet1997 Make sure you have not set your SpashActivity as the launcher activity in manifest .

korantengNanaYaw avatar Aug 29 '18 23:08 korantengNanaYaw

Hi I have problem about Awesome splash please help Am student working on fyp. dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:support-v4:28.0.0' androidTestImplementation 'com.android.support.test:runner:1.0.2' implementation('com.github.ViksaaSkool:AwesomeSplash:v1.0.0') { exclude group: 'com.android.support' } androidTestImplementation ('com.android.support.test.espresso:espresso-core:3.0.2', { exclude group: 'com.android.support', module: 'support annotations' }) }

//code @Override public void initSplash(ConfigSplash configSplash) { Toast.makeText(this,"hlw",Toast.LENGTH_SHORT).show(); ActionBar actionBar=getSupportActionBar(); actionBar.hide(); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); //give full screen

    //Set backgroud colour
    Toast.makeText(this,"hlw",Toast.LENGTH_SHORT).show();
    configSplash.setBackgroundColor(R.color.colorPrimary);
    configSplash.setAnimCircularRevealDuration(3000);
    configSplash.setRevealFlagX(Flags.REVEAL_BOTTOM);
    configSplash.setRevealFlagX(Flags.REVEAL_LEFT);
    configSplash.setLogoSplash(R.drawable.zz);
    configSplash.setAnimLogoSplashDuration(5000);
    configSplash.setAnimLogoSplashTechnique(Techniques.Bounce);
    configSplash.setTitleSplash("Bus Application");
    configSplash.setTitleTextColor(R.color.colorAccent);
    configSplash.setAnimTitleDuration(3000);
    configSplash.setAnimTitleTechnique(Techniques.FlipInX);
}

@Override
public void animationsFinished() {
    Intent intent=new Intent(this,Main2Activity.class);
    startActivity(intent);

}

}

Application crash without show any msg....

ammara121 avatar Feb 26 '19 13:02 ammara121