1

I've looked through a lot of other threads about this but haven't had any luck yet with their solutions. When I launch my app for the first time, I noticed that onResume is being called after onCreate. (not sure why) My problem is when I try to run the application for the second time. Neither onCreate nor onResume get called, it just sits there. ALso, I have these setting set in my manifest:

android:clearTaskOnLaunch="true" 
android:screenOrientation="landscape" 
android:noHistory="true"

If I ever want to run my app more than once, I have to go into settings->applications->app-name->force-close

(I don't have access to look for any loops or bad bugs that might be causing the sticking because I'm using a library with it's own threads.)

Is there a way I can fix this?

user980058
  • 511
  • 7
  • 18

2 Answers2

4

Call Process.sendSignal(Process.myPid(), Process.SIGNAL_KILL); in your onDestroy method. This is not good but the best solution for this problem.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
0

This is the way android manages the activities. If you want your activity go through whole life cycle, call explicitly its finish() method.

a.ch.
  • 8,285
  • 5
  • 40
  • 53
  • I already tried putting finish() in both onStop and onPause but it didn't help. I'm not entirely convinced that they were even being called. – user980058 Dec 02 '11 at 13:40
  • To make sure they are called add a breakpoint to them or print some message within them with `Log.e(String, String)`, for example – a.ch. Dec 02 '11 at 14:17
  • Set `android:clearTaskOnLaunch` to "false" and see what you get. And it would be nice if you provide a source code of the activity which is not recreated after calling its finish() method. – a.ch. Dec 02 '11 at 14:20