Tuesday, July 17, 2012

[android-developers] Seeing wierd things with JB on Nexus 7 and timers/activities

1st:  This does NOT occur on ICS.

I have two Activities that I cycle between.  Game screen and Results screen (don't complain about not using Activity Fragments).

I end one with finish() and then call the next.  If I exit out using the back button, some time later one of the Activies pops up.  Presumably because the timed game round ends and the next activity is auto-started or something.

Additionally, I have a timer loop using Runnable.  Inside the loop I do things like this:

if (game_time > 0 && game_time < 5 && flag)
{
  flag = false;    /// class variable
  Log.i("WTF", "Why do I see this message more than once?");
... }

Well, this code gets run MULTIPLE times.... I can see the log messages.

If I upload the EXACT same APK to an ICS device, these behaviors do not happen.

I also see this message in the log:
07-18 00:05:51.187: I/Choreographer(20425): Skipped 42 frames!  The application may be doing too much work on its main thread.

Is anyone seeing anything similar or can explain this ?


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment