android - Activity lifecycle strange behavior in sleep mode (libGDX game) -


i have strange behavior of activity in libgdx game - when play game , press power button sending device sleep mode. i've added logs activity's callback methods , that's see:

05-14 16:32:51.694: i/bp(32656): onpause() 05-14 16:32:51.704: i/bp(32656): onstop() 05-14 16:32:51.854: i/bpapplication(32656): bpapplication.onconfigurationchanged() 05-14 16:32:51.854: i/bp(32656): bp.onconfigurationchanged() 

at point goes right way. further strange begins:

05-14 16:40:42.774: i/bp(32656): onrestart() 05-14 16:40:42.774: i/bp(32656): onstart() 05-14 16:40:43.064: i/bp(32656): onresume() 05-14 16:40:44.566: i/bp(32656): bp.onconfigurationchanged() 05-14 16:40:44.566: i/bpapplication(32656): bpapplication.onconfigurationchanged() 05-14 16:40:49.761: i/system.out(32656): screen resize w = 480, h=800 // libgdx callback 05-14 16:40:49.911: i/system.out(32656): game resumed...              // libgdx callback 05-14 16:40:50.471: i/system.out(32656): screen resize w = 800, h=480 // libgdx callback 05-14 16:40:59.010: i/system.out(32656): game paused                  // libgdx callback 05-14 16:41:00.711: i/bp(32656): onpause() 05-14 16:41:00.801: i/bp(32656): onstop() 05-14 16:41:00.851: i/bp(32656): onrestart() .... cycle repeats 5 - 10 times .... 

so can see problem activity.onrestart() , further callbacks calls when device asleep. , repeats 5-10 times during near 1 minute.
don't understand why activity restarts , performing operation. im game have billing service v2 (implemented other programmer) , setup alarmmanager restore free game.

i confused issue appreciated.

update

it seems deal in libgdx - i've build project same library version , behaves game.

in androidmanifest.xml, should have like-

<activity    android:name=".yourappname"   android:configchanges="keyboardhidden|orientation|screensize"/> 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -