You can check what the transformation displays with TransformationMethod.getTransformation (CharSequence, View). Instead of checking for zero, you should actually run the conversion and make sure that "textShown" is what you expect.
// EditText editText;
CharSequence realText = editText.getText();
CharSequence textShown = editText.getTransformationMethod().getTransformation(realText, editText);
source
share