In my android app, I need to use Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK
to set my intent flag. I can remove all my previous Activities
and start a new Activity
in this way.This is my code below:
Intent intent = new Intent(Gerenxinxi.this, MainPart.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
finish();
overridePendingTransition(0,0);
However,I found a flicker of black screen when i use the code above. If I don't set intent flag with Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK
, the flicker of black screen will be gone.My question is: what can I do to avoid the black screen when Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK
is set ?
Before I write down this question, I have found that someone has the similar question.This is the link However,the answers of this question can not solve my problem.So I ask the question again.I hope anyone can help me.Thank you.
This initial screen that you see is called the "Preview" screen. You can disable this completely by declaring this in your theme:
Try this
Add this line in your style
only one solution i found it instead of showing black screen show app theme background. in my case its white