Android: Black Screen between Activity

后端 未结 5 405
误落风尘
误落风尘 2021-01-05 06:45

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 startActv

5条回答
  •  走了就别回头了
    2021-01-05 07:28

    You don't need to manage finshing your activity, this will be managed automatically when the activity is no longer in view. Just use:

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

    And use this code in whatever method you are using to navigate the activity changes.

    If you make sure your window is the background of your activities you can set the window background to a color other than black:

    @drawable/window_background
    
    
        
    
    

    windowBackground in Android 6 (Marshmallow)

    The other option is to manage transitions, so there is no gap between the end of the first transition and the beginning of the second. However, you have not mentioned transitions.

    How to remove the delay when opening an Activity with a DrawerLayout?

提交回复
热议问题