android - Why is my Activity runs from the top again when resumed instead of doing nothing? -


i have activity displays table database. when press power button turn off screen, pressing power button again resume activity, table loads again , did on create. why activity running again when resume it?

i put onresume() , left blank/default.

@override protected void onresume() {     super.onresume();  } 

accordingly, call methods according follows, never call oncreate() data reloaded,

on launching activity call --> oncreate(), onstart(), onresume(),

onpower key off --> onpause(), onstop()

onpower key on --> onrestart(), onstart(), onresume()

to prevent reloading data there many cases this , this link

may due :

android:configchanges="orientation|keyboardhidden|screensize" 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -