Android: black screen between actions

When I switch from one activity to another activity, a black screen appears within a few seconds between transactions. I will finish the job correctly before calling startActvity () .

I use the theme android: theme = "@android: style / Theme.Translucent" for my activity. Although a black screen appears between the activity transaction

Can someone tell me how to solve this problem?

Thank you in advance:)

+4
source share
4 answers

startActivity().

, onCreate ( onCreate, onStart onResume, ).

+1

:

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

:

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

: -

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

    // comment code here
    }

A B, OnCreate, OnResume B. , , , . , .

+1

, , . :

startActivity(new Intent(this, MyNextActivity.class));

, .

, , , :

<item name="android:windowBackground">@drawable/window_background</item>

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
    <solid android:color="@color/window_background"/>
</shape>

windowBackground Android 6 (Marshmallow)

- , . .

How to remove the delay when opening an operation using DrawerLayout?

+1
source

Source: https://habr.com/ru/post/1620717/


All Articles