0

I want to call logout method on Android application when application is uninstalled.

 private void setlogout() {
        StringRequest stringRequest = new StringRequest(Request.Method.GET, logout,
                new Response.Listener<String>() {
                    @Override
                    public void onResponse(String response) {
                     //   Toast.makeText(getApplicationContext(), "logout successfully", Toast.LENGTH_SHORT).show();
                    }
                },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                      //  Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();
                    }
                });
        //adding our stringrequest to queue
        Volley.newRequestQueue(this).add(stringRequest);
    }
MMG
  • 3,105
  • 5
  • 11
  • 38
Usama Hassan
  • 71
  • 1
  • 8
  • Possible duplicate of [Can I catch uninstall action in my Android app](https://stackoverflow.com/questions/3313317/can-i-catch-uninstall-action-in-my-android-app) – stephendnicholas May 10 '18 at 11:43
  • Check this link https://stackoverflow.com/a/18816716/4657385 – sm_ May 10 '18 at 11:47

0 Answers0