# Can't activate the flash after entering multi tasking

**URL:** <https://discourse.processing.org/t/cant-activate-the-flash-after-entering-multi-tasking/26658>\
**Category:** Processing for Android\
**Created:** [December 31, 2020, 8:17pm UTC](https://discourse.processing.org/t/cant-activate-the-flash-after-entering-multi-tasking/26658 "2020-12-31T20:17:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca1017](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@Luca1017](https://discourse.processing.org/u/Luca1017)\
**Post date:** [December 31, 2020, 8:17pm UTC](https://discourse.processing.org/t/cant-activate-the-flash-after-entering-multi-tasking/26658/1 "2020-12-31T20:17:18Z")

</div>

I made this simple code for activating and deactivating the flash of the phone and it’s working fine, but when i go in the multi tasking and then i re-enter in the app (without closing it) I can’t manage to re-activate the flash. I’m using Ketai library and I have allowed the permission to camera. This is the code:

```auto
import ketai.camera.*;

PImage flashOn;
PImage flashOff;
KetaiCamera cam;

void setup()
{
  imageMode(CENTER);
  cam = new KetaiCamera(this, 320, 240, 24);
  cam.start();
  flashOn = loadImage("flashOn.png");
  flashOff = loadImage("flashOff.png");
}

void draw()
{
  background(176);

  if (cam.isFlashEnabled())

    image(flashOn, width/2, height/2, width, width);
  else
    image(flashOff, width/2, height/2, width, width);
}

void mousePressed()
{
  if (cam.isFlashEnabled())
    cam.disableFlash();
  else
    cam.enableFlash();
}

```

Is there a way to make the program function even after going in the multi tasking and re-entering the app?

Thanks for your help.
