I know I can use AlertDialog
for this, but without creating a button, only when the user is pressing the back to exit does an alert appear? Type, when it comes out (this involves the Android system in the part that does it alone) would a "finish" that Android understand and picking from it would create arguments to be sure even it will quit?
Note: The intention was for onDestroy () to stop the stream, only when it is closing the application, I was going to put within this type of argument. Not to stop when you just leave the class.