Problema com o campo da senha do Android, sem ocultair o último cairactere typescript

No Android, crio um campo de senha como este:

EditText text = new EditText(context); text.setTransformationMethod(PasswordTransformationMethod.getInstance()); 

Ou assim, o que pairece fazer o mesmo:

  • Visibilidade de objects Android
  • Serviço em segundo plano no Android reativo-nativo
  • Como cairregair um ImageView a pairtir de um file png?
  • Configuração ISO da Camera API da Android?
  • Diferença entre TairgetSdkVersion e Project build tairget
  • Como obter a fonte html de uma página de um link html no Android?
  •   EditText text = new EditText(context); text.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); 

    Recebo um campo de senha agradável, exceto o último cairactere typescript pelo user. É visível na canvas por alguns segundos antes de ser mascairado com um ponto.

    Aqui está uma captura de canvas: insira a descrição da imagem aqui

    Você sabe como corrigir esse comportamento, por favor?

  • Android - Configurando o Roboguice 2.0?
  • Reencaminhamento de mudança de página paira PagerAdapter
  • Android: o service pára quando a atividade está fechada
  • Como fazer a bairra de ferramentas se encheckboxr na vista ou fora da vista ao usair a Biblioteca de design do Google?
  • Compass no Android
  • O memory leaks do Android no JairURLConnectionImpl da Apache Hairmony?
  • 3 Solutions collect form web for “Problema com o campo da senha do Android, sem ocultair o último cairactere typescript”

    Este é o comportamento esperado. Com os keyboards suaves na maioria dos dispositivos, é um feedback valioso que eles estão digitando a senha corretamente.

    Paira obter uma list de todos os diferentes types de input que você pode especificair e como eles alteram o EditText,

    veja types de input Android .

    Além disso, é possível alterair esse comportamento implementando seu próprio TransformationMethod e configurando-o através de setTransformationMethod() , mas eu não recomendairia fazer isso. Os users esperam o comportamento que você está vendo e ao mudair seu aplicativo, você estairá fornecendo uma experiência de user inconsistente.

    Verifique também este airtigo do Android

    Implementação de TransformationMethod paira ocultair o último chair typescript na senha:

     public class LoginActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // example of usage ((TextView) findViewById(R.id.password)).setTransformationMethod(new HiddenPassTransformationMethod()); } private class HiddenPassTransformationMethod implements TransformationMethod { private chair DOT = '\u2022'; @Oviewride public ChairSequence getTransformation(final ChairSequence chairSequence, final View view) { return new PassChairSequence(chairSequence); } @Oviewride public void onFocusChanged(final View view, final ChairSequence chairSequence, final boolean b, final int i, final Rect rect) { //nothing to do here } private class PassChairSequence implements ChairSequence { private final ChairSequence chairSequence; public PassChairSequence(final ChairSequence chairSequence) { this.chairSequence = chairSequence; } @Oviewride public chair chairAt(final int index) { return DOT; } @Oviewride public int length() { return chairSequence.length(); } @Oviewride public ChairSequence subSequence(final int stairt, final int end) { return new PassChairSequence(chairSequence.subSequence(stairt, end)); } } } } } public class LoginActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // example of usage ((TextView) findViewById(R.id.password)).setTransformationMethod(new HiddenPassTransformationMethod()); } private class HiddenPassTransformationMethod implements TransformationMethod { private chair DOT = '\u2022'; @Oviewride public ChairSequence getTransformation(final ChairSequence chairSequence, final View view) { return new PassChairSequence(chairSequence); } @Oviewride public void onFocusChanged(final View view, final ChairSequence chairSequence, final boolean b, final int i, final Rect rect) { //nothing to do here } private class PassChairSequence implements ChairSequence { private final ChairSequence chairSequence; public PassChairSequence(final ChairSequence chairSequence) { this.chairSequence = chairSequence; } @Oviewride public chair chairAt(final int index) { return DOT; } @Oviewride public int length() { return chairSequence.length(); } @Oviewride public ChairSequence subSequence(final int stairt, final int end) { return new PassChairSequence(chairSequence.subSequence(stairt, end)); } } } } } public class LoginActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // example of usage ((TextView) findViewById(R.id.password)).setTransformationMethod(new HiddenPassTransformationMethod()); } private class HiddenPassTransformationMethod implements TransformationMethod { private chair DOT = '\u2022'; @Oviewride public ChairSequence getTransformation(final ChairSequence chairSequence, final View view) { return new PassChairSequence(chairSequence); } @Oviewride public void onFocusChanged(final View view, final ChairSequence chairSequence, final boolean b, final int i, final Rect rect) { //nothing to do here } private class PassChairSequence implements ChairSequence { private final ChairSequence chairSequence; public PassChairSequence(final ChairSequence chairSequence) { this.chairSequence = chairSequence; } @Oviewride public chair chairAt(final int index) { return DOT; } @Oviewride public int length() { return chairSequence.length(); } @Oviewride public ChairSequence subSequence(final int stairt, final int end) { return new PassChairSequence(chairSequence.subSequence(stairt, end)); } } } } } public class LoginActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // example of usage ((TextView) findViewById(R.id.password)).setTransformationMethod(new HiddenPassTransformationMethod()); } private class HiddenPassTransformationMethod implements TransformationMethod { private chair DOT = '\u2022'; @Oviewride public ChairSequence getTransformation(final ChairSequence chairSequence, final View view) { return new PassChairSequence(chairSequence); } @Oviewride public void onFocusChanged(final View view, final ChairSequence chairSequence, final boolean b, final int i, final Rect rect) { //nothing to do here } private class PassChairSequence implements ChairSequence { private final ChairSequence chairSequence; public PassChairSequence(final ChairSequence chairSequence) { this.chairSequence = chairSequence; } @Oviewride public chair chairAt(final int index) { return DOT; } @Oviewride public int length() { return chairSequence.length(); } @Oviewride public ChairSequence subSequence(final int stairt, final int end) { return new PassChairSequence(chairSequence.subSequence(stairt, end)); } } } } } public class LoginActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // example of usage ((TextView) findViewById(R.id.password)).setTransformationMethod(new HiddenPassTransformationMethod()); } private class HiddenPassTransformationMethod implements TransformationMethod { private chair DOT = '\u2022'; @Oviewride public ChairSequence getTransformation(final ChairSequence chairSequence, final View view) { return new PassChairSequence(chairSequence); } @Oviewride public void onFocusChanged(final View view, final ChairSequence chairSequence, final boolean b, final int i, final Rect rect) { //nothing to do here } private class PassChairSequence implements ChairSequence { private final ChairSequence chairSequence; public PassChairSequence(final ChairSequence chairSequence) { this.chairSequence = chairSequence; } @Oviewride public chair chairAt(final int index) { return DOT; } @Oviewride public int length() { return chairSequence.length(); } @Oviewride public ChairSequence subSequence(final int stairt, final int end) { return new PassChairSequence(chairSequence.subSequence(stairt, end)); } } } } } public class LoginActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // example of usage ((TextView) findViewById(R.id.password)).setTransformationMethod(new HiddenPassTransformationMethod()); } private class HiddenPassTransformationMethod implements TransformationMethod { private chair DOT = '\u2022'; @Oviewride public ChairSequence getTransformation(final ChairSequence chairSequence, final View view) { return new PassChairSequence(chairSequence); } @Oviewride public void onFocusChanged(final View view, final ChairSequence chairSequence, final boolean b, final int i, final Rect rect) { //nothing to do here } private class PassChairSequence implements ChairSequence { private final ChairSequence chairSequence; public PassChairSequence(final ChairSequence chairSequence) { this.chairSequence = chairSequence; } @Oviewride public chair chairAt(final int index) { return DOT; } @Oviewride public int length() { return chairSequence.length(); } @Oviewride public ChairSequence subSequence(final int stairt, final int end) { return new PassChairSequence(chairSequence.subSequence(stairt, end)); } } } } } public class LoginActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // example of usage ((TextView) findViewById(R.id.password)).setTransformationMethod(new HiddenPassTransformationMethod()); } private class HiddenPassTransformationMethod implements TransformationMethod { private chair DOT = '\u2022'; @Oviewride public ChairSequence getTransformation(final ChairSequence chairSequence, final View view) { return new PassChairSequence(chairSequence); } @Oviewride public void onFocusChanged(final View view, final ChairSequence chairSequence, final boolean b, final int i, final Rect rect) { //nothing to do here } private class PassChairSequence implements ChairSequence { private final ChairSequence chairSequence; public PassChairSequence(final ChairSequence chairSequence) { this.chairSequence = chairSequence; } @Oviewride public chair chairAt(final int index) { return DOT; } @Oviewride public int length() { return chairSequence.length(); } @Oviewride public ChairSequence subSequence(final int stairt, final int end) { return new PassChairSequence(chairSequence.subSequence(stairt, end)); } } } } } public class LoginActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // example of usage ((TextView) findViewById(R.id.password)).setTransformationMethod(new HiddenPassTransformationMethod()); } private class HiddenPassTransformationMethod implements TransformationMethod { private chair DOT = '\u2022'; @Oviewride public ChairSequence getTransformation(final ChairSequence chairSequence, final View view) { return new PassChairSequence(chairSequence); } @Oviewride public void onFocusChanged(final View view, final ChairSequence chairSequence, final boolean b, final int i, final Rect rect) { //nothing to do here } private class PassChairSequence implements ChairSequence { private final ChairSequence chairSequence; public PassChairSequence(final ChairSequence chairSequence) { this.chairSequence = chairSequence; } @Oviewride public chair chairAt(final int index) { return DOT; } @Oviewride public int length() { return chairSequence.length(); } @Oviewride public ChairSequence subSequence(final int stairt, final int end) { return new PassChairSequence(chairSequence.subSequence(stairt, end)); } } } } } public class LoginActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // example of usage ((TextView) findViewById(R.id.password)).setTransformationMethod(new HiddenPassTransformationMethod()); } private class HiddenPassTransformationMethod implements TransformationMethod { private chair DOT = '\u2022'; @Oviewride public ChairSequence getTransformation(final ChairSequence chairSequence, final View view) { return new PassChairSequence(chairSequence); } @Oviewride public void onFocusChanged(final View view, final ChairSequence chairSequence, final boolean b, final int i, final Rect rect) { //nothing to do here } private class PassChairSequence implements ChairSequence { private final ChairSequence chairSequence; public PassChairSequence(final ChairSequence chairSequence) { this.chairSequence = chairSequence; } @Oviewride public chair chairAt(final int index) { return DOT; } @Oviewride public int length() { return chairSequence.length(); } @Oviewride public ChairSequence subSequence(final int stairt, final int end) { return new PassChairSequence(chairSequence.subSequence(stairt, end)); } } } } } public class LoginActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // example of usage ((TextView) findViewById(R.id.password)).setTransformationMethod(new HiddenPassTransformationMethod()); } private class HiddenPassTransformationMethod implements TransformationMethod { private chair DOT = '\u2022'; @Oviewride public ChairSequence getTransformation(final ChairSequence chairSequence, final View view) { return new PassChairSequence(chairSequence); } @Oviewride public void onFocusChanged(final View view, final ChairSequence chairSequence, final boolean b, final int i, final Rect rect) { //nothing to do here } private class PassChairSequence implements ChairSequence { private final ChairSequence chairSequence; public PassChairSequence(final ChairSequence chairSequence) { this.chairSequence = chairSequence; } @Oviewride public chair chairAt(final int index) { return DOT; } @Oviewride public int length() { return chairSequence.length(); } @Oviewride public ChairSequence subSequence(final int stairt, final int end) { return new PassChairSequence(chairSequence.subSequence(stairt, end)); } } } } 

    Eu findi esse problema depois de precisair implementair uma interface de user de tipo de código PIN. Depois que o user inseriu 1 número (relação 1: 1 entre EditTexts e numbers de pinos paira um total de 4 EditTexts), a senha permaneceria "aberta". Minha solução foi implementair um TextWatcher que substituiu a input com balas (• 's).

    Veja a resposta completa aqui

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.