Android: Black Screen between Activity

14,349

Solution 1

There is no need to finish activity before calling startActivity().

Make sure that you have set content view in the onCreate of called Activity and that you are not blocking UI thread (check onCreate, onStart and onResume if you have override them).

Solution 2

for disable this default animation create one style:

<style name="noAnimTheme" parent="android:Theme">
<item name="android:windowAnimationStyle">@null</item>
</style>

and set it as theme for your activity in the manifest:

<activity android:name=".ui.ArticlesActivity" android:theme="@style/noAnimTheme">
</activity>

Solution 3

Assumption :-

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.xyz);

    // comment code here
    }

If you go from activity A to B then try to comment code in OnCreate , OnResume in Activity B Like this and check what happen still black screen is coming or not.If coming then try to change theme.

Share:
14,349
Binil Surendran
Author by

Binil Surendran

Am always act with wisdom, am dosen't make decisions before weighed the pros and cons.

Updated on July 20, 2022

Comments

  • Binil Surendran
    Binil Surendran almost 2 years

    When I go one activity to another activity , between the transaction a Black screen is come for some seconds. I properly finish the activity before calling startActvity().

    Am using android:theme="@android:style/Theme.Translucent" theme for my activity. Even though between the activity transaction a black screen is coming

    Can any one please tell me how to resolve this

    Thanks in advance :)