New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
LuvinAndroid
Old
#1  
Member - OP
Thanks Meter 2
Posts: 42
Join Date: Oct 2010
Default [Q] How to insert a "run this always" loop

Hi Everyone,

Using the SkeletonApp default code, how would I insert a void or whatever (sorry not knowing the terminology yet) that would run each cycle of the program like a counter or something?

Just keep it simple, just a "run this always" loop while maintaining the button functions would be great.

thanks and hope you all had a happy thanksgiving
 
LuvinAndroid
Old
#2  
Member - OP
Thanks Meter 2
Posts: 42
Join Date: Oct 2010
So I added this and it does not work, how in the world do I get a counter working ?
Please, Please someone point me in the right direction?

All I want it to do (in the default SkellyApp) is count to 30, then end the proggy. And yes, I did make the mytimer a variable at the top of my proggy.

public int mytimer;

-------- stuff ---------

@Override
public void onResume() {
mytimer = (mytimer + 1);
if (mytimer == 30) finish();
super.onResume();
}

thank you in advance for taking the time to look, and HOPEFULLY answer this for me.