0

I have a simple Hello World app, created in Android Studio. When I run my application and in my device I pressed the back button, it remains running in the Android Studio until I press the stop button in this IDE.

enter image description here

why does app remain running?

Farhad
  • 12,178
  • 5
  • 32
  • 60
mohammad
  • 1,248
  • 3
  • 15
  • 27

3 Answers3

2

In a typical scenario, when you press back button your activity is paused and maybe destroyed some time later. But according to the images, this is the Instant Run process of the Gradle Plugin v2.0+ which is still running, and makes the hot deployment of the application possible.

The Instant Run, deploys only what has changed in the application, and not the whole uninstall/reinstall process.

Farhad
  • 12,178
  • 5
  • 32
  • 60
0

Because app is not destroyed ,it only goes background when back button pressed.if you kill the application from task manager the stop button will be removed by studio

itzmebibin
  • 9,199
  • 8
  • 48
  • 62
Vishnu V S
  • 355
  • 1
  • 10
0

you can achieve this via your application also by adding onPause menthod

    @Override
    protected void onPause() {
        super.onPause();
        finish();
    }
Mithilesh Izardar
  • 2,117
  • 1
  • 13
  • 24