Set visibility of password in edittext
<p>This code is correct when the inputType is text but i want the same for password type number.On click of the checkbox i want the password to be visible.</p>

<pre><code>checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if(isChecked) {
                    password.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
                } else {
                    password.setInputType(129);
                }
            }
        });
</code></pre>
