i want to show traffic in google maps and to hide it with the same button : I want to **show and hide traffic** with the same button..so i tried method

(onClick) in my xml and my java code is

    public void traffic (View view){

        ImageButton bttn=findViewById(R.id.traffic);

        if(bttn.isClickable()){
            mMap.setTrafficEnabled(true);
        }

        else {
            mMap.setTrafficEnabled(false);
        }

but it doesnt work!!!   it only shows traffic and if i press it again nothing happen!

please tell me what i miss in my code !!!!   