onCreate bug?

edited February 2014 in Android Mode

I've been experiencing some weird bug while coding an app. Let's see if I can explain this.

I have imported my code into Eclipse. The bug only appears when I export a signed APK, never when running the app in debug mode.

Here's the problem:

When I first run the app in a device, everything seems to go well, but if I send the activity to the background and then reopen it by clicking on the icon again, it all becomes buggy (in a way I can't quite explain: colours change, sizes are messed up, things disappear...). This happens ONLY the first time the app is run. I just have to force close the app and this behaviour won't happen ever again (as far as I can tell).

So I had a look at what the activity lifecycle was in both cases (with and without the bug):

Without bug:

  • Activity is running.
  • Activity is sent to back
  • onPause()
  • onStop

  • We click on the app button again

  • onStart
  • onResume

With bug:

  • Activity is running.
  • Activity is sent to back
  • onPause()
  • onStop

  • We click on the app button again

  • onCreate
  • onStart
  • onResume

--

I'm quite sure that "onCreate" should not be there, because my Activity has already been created... Now, I'm not sure if this is an Android or a Processing issue, or if something in my code is provoking this weird behaviour.

Has someone experienced this before? :S

Answers

Sign In or Register to comment.