How to avoid "The activity has not begun, its current task has been moved to the forefront"?

If I do not change the source code and compile, I get the message "Activity is not running, its current task has been moved to the foreground." Is there an option in Eclipse to make it work without changing the source code?

+6
source share
7 answers

If you want to force this, do it. I usually do this, although it sounds weak. Add a location anywhere in your code (in any file). Just save the project and run. Then it will start the download and installation process again. This is the easiest way to do this without modifying any code.

+9
source

why don't you try running it from the emulator again. If you do not change the source, it will do the same as you mentioned, either change the source (you can add logs, or just make an empty input in any file.) Or close it and open it from the emulator.

+1
source

-> This only happens if there are no changes in the previous application launch.
-> To avoid this, you can:

  • Close the application and then compile,
  • You need to modify the atleast 1 file of your code and then compile it.
+1
source

There is another way to solve this problem. Launch another application and run your current application so that you do not receive this type of error message. And no need to change the code or add unnecessary spaces. and it will also save your time, which can be dropped to restart the emulator.

+1
source

If you do not modify the code and want to re-run the code in the emulator, the system simply issues a warning that the code you are trying to run has already been executed. Even I came across this warning several times. You can do makes some changes to the code and try to start again or just finish all the actions ahead, and then try to run. It will work successfully.

0
source

In my opinion, "Activity has not begun, its current task ..." is really tiring. In some cases, I did not change anything in the source code, but I need to restart because I changed the data

0
source

Clean your project (Menu-> Project-> Clear), then Run it again.

It works for me.

0
source

Source: https://habr.com/ru/post/920663/


All Articles