What is the different between locking screen and pressing home button on android?

I am writing a UE plugin for android devices,and rewrite some rendering function.A strange appearance shows all the time.

  1. If press power button to lock the screen, and then press again to unlock, everything goes well.
  2. If press home button to back to launcher,and then reopen the app, nothing is shown. then if do step 1, things go well again.
    so what is going on ? could anybody tell the reason why this happens??
    Thanks a lot!!!

Explain more please, what do you mean by “nothing is shown” you got black screen? What exactly did you modify? Do your code is sleep state aware in anyway?

I recommand you to read about app life cycle in Android developer docs

Remember that by Android framework, UE4 is a single activity (Native activity if i’m not mistaken) running native code via NDK

Yes,I got black screen but could be resumed from specific operation(press power button), I modified a lot basically on render thread ,but that seems like running well.
I did not modify java activity code, cause UE runs mainly on .so file(C++) as you said.
App seems run well only in LOG, no error or warning occurs.