Android Question Activity_create called when phone goes to sleep

ivavilagu

Member
Licensed User
Longtime User
When I press the sleep button on my phone, the activity_create is getting called (been False the FirstTime variable). Why is that happening?

Is maybe because the orientation is locked?
 

ivavilagu

Member
Licensed User
Longtime User
Yes, the orientation is locked in landscape mode


** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false ** //Here I pressed the sleep mode button phone
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
 
Upvote 0

ivavilagu

Member
Licensed User
Longtime User
Ok, I solved the problem adding the line
SetActivityAttribute(Main, android:configChanges, "orientation|keyboardHidden|screenSize")
to manifest editor.
 
Upvote 0
Top