AwesomeSplash
AwesomeSplash copied to clipboard
Error shown Cannot start this animator on a detached view!
I cant start activity error shows Cannot start this animator on a detached view!
are you sure you're following the guides?
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.
Can you send me a gist/pastebin of your Activity that extends AwesomeSplash?
i,m facing same error :( any solution ?
Can you send me a gist/pastebin of your Activity that extends AwesomeSplash?
Don't override OnCreate method.
Hey , I have the same issue..Can you help me with error.. Thanks.
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);
}
});
}
}
}
@abhijeet1997 Make sure you have not set your SpashActivity as the launcher activity in manifest .
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....