1

I want to test if the onCreate/onDestroy flow works fine when running my Espresso tests, and I can enable "Don't keep activities" from the developer options on the device manually but I can't find a way to do it on remote devices, like firebase test farm.

Is there any way to do this programmatically?

Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162

1 Answers1

0

Like here How to know "Don't keep activities" is enabled in ICS? have you try this :

Settings.Global.putInt(getContentResolver(),Settings.Global.ALWAYS_FINISH_ACTIVITIES,  1);
SebSer
  • 194
  • 1
  • 5
  • 1
    Thanks but I need `android.permission.WRITE_SECURE_SETTINGS` for that and it says `this is only granted to system apps`, any other idea? – Daniel Gomez Rico Jan 29 '19 at 16:56