I am using this link 1 to detect the swiping right on my main activity and using this link 2 to put the alertbuilder in the event Handler.
Link 1: Android: How to handle right to left swipe gestures
Link2: How can I put "Are you sure you want to exit?" when I press back button android
But I get an error
E/WindowManager: android.view.WindowLeaked: Activity de.dfki.av.mhs.peripheralwatch.MainActivity has leaked window DecorView@334a170[MainActivity] that was originally added here
How to add a confirmation screen for the user before he exits the app?