Search code examples
processgoogle-playandroid-lifecycle

Forcefully, but gracefully, shut down incompatible Android app


My app requires OpenGL-ES3, and states this in the Manifest.

Yet, somehow, it frequently gets launched on ES2 devices, judging from the crash logs. I don't understand how the user managed to install it on an incompatible device, but here we are.

I want to add detection for ES2-only devices. Once detected, I need the app to warn the customer and then completely shut down.

There does not seem to be a proper manner in which an android app (its process) is ended. Android will just keep it alive, even if you call something like finish().

How can I force a REAL exit of an incompatible app?


Solution

  • To get the openGL ES version take a look at: Is there a way to check if Android device supports openGL ES 2.0?

    To exit from the app, have you try this?:

    getActivity().finish();
    System.exit(0);