I'm building a phonegap app and I want to use prompt. Here is my code from index.js
navigator.notification.prompt(
'Please enter your password', // message
startSmsPrompt, // callback
'Login', // title
['Ok','Cancel'], // buttonName
'Password' // hint
);
The problem is when the prompt opens and I enter the password, its in clear text (meaning, the characters aren't replaced with * or bullets). I want to hide the password. I also tried changing the code in
plugins/org.apache.cordova.dialogs/src/android/Notification.java
I changed the promptInput to
promptInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
And
promptInput.setTransformationMethod(PasswordTransformationMethod.getInstance());
But these two changes, made no difference to my prompt dialog. I want to hide the password, any tips?
I found my answer on this thread.
Set inputType for an EditText?
Turns out you just need to add one line in
App Name\platforms\android\src\org\apache\cordova\dialogs\Notification.java
promptInput.setInputType(0x00000081);
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다