How to hide password in phonegap prompt

Mujeeb

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?

Mujeeb

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] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to set Windows not to prompt for password on resume from sleep

분류에서Dev

In Windows 10 How To Keep Password Prompt From Appearing On Sleep?

분류에서Dev

How to get sudo to prompt you for a password each time

분류에서Dev

How to encrypt/hide password in /etc/network/interfaces file on debian?

분류에서Dev

How do disable user list on login screen? (Prompt for username and password) Ubuntu 15.10

분류에서Dev

How to avoid encrypted boot partition password prompt in LVM- arch linux

분류에서Dev

Hide password using expect script

분류에서Dev

django-lockdown password prompt not displayed

분류에서Dev

Windows 10 password prompt not showing on startup

분류에서Dev

Feedback when typing password at a sudo prompt

분류에서Dev

ubuntu drop to root shell prompt asks for password

분류에서Dev

Screen locker doesn't prompt for password

분류에서Dev

Phonegap how does it work?

분류에서Dev

Hide password in python using getpass.getpass()

분류에서Dev

Virt-Manager to Remote host - continuous password prompt over ssh

분류에서Dev

SSH->SCP connection without password prompt on every attempt

분류에서Dev

How to trim string in command prompt?

분류에서Dev

How to start XTerm with prompt at the bottom?

분류에서Dev

How to update prompt on directory change

분류에서Dev

Bootstrap Input Password Show Hide with bootstrap-float-label css

분류에서Dev

How to show/hide divs

분류에서Dev

How to hide window borders?

분류에서Dev

How to use database password?

분류에서Dev

How to set password for MySQL?

분류에서Dev

How to store a password?

분류에서Dev

1Password처럼 Phonegap 앱에서 외부 양식 채우기

분류에서Dev

how to remove bottom space in windows phone phonegap?

분류에서Dev

how to give id dynamically to an element in phonegap?

분류에서Dev

phonegap + jqmobile: how to change page correctly

Related 관련 기사

  1. 1

    How to set Windows not to prompt for password on resume from sleep

  2. 2

    In Windows 10 How To Keep Password Prompt From Appearing On Sleep?

  3. 3

    How to get sudo to prompt you for a password each time

  4. 4

    How to encrypt/hide password in /etc/network/interfaces file on debian?

  5. 5

    How do disable user list on login screen? (Prompt for username and password) Ubuntu 15.10

  6. 6

    How to avoid encrypted boot partition password prompt in LVM- arch linux

  7. 7

    Hide password using expect script

  8. 8

    django-lockdown password prompt not displayed

  9. 9

    Windows 10 password prompt not showing on startup

  10. 10

    Feedback when typing password at a sudo prompt

  11. 11

    ubuntu drop to root shell prompt asks for password

  12. 12

    Screen locker doesn't prompt for password

  13. 13

    Phonegap how does it work?

  14. 14

    Hide password in python using getpass.getpass()

  15. 15

    Virt-Manager to Remote host - continuous password prompt over ssh

  16. 16

    SSH->SCP connection without password prompt on every attempt

  17. 17

    How to trim string in command prompt?

  18. 18

    How to start XTerm with prompt at the bottom?

  19. 19

    How to update prompt on directory change

  20. 20

    Bootstrap Input Password Show Hide with bootstrap-float-label css

  21. 21

    How to show/hide divs

  22. 22

    How to hide window borders?

  23. 23

    How to use database password?

  24. 24

    How to set password for MySQL?

  25. 25

    How to store a password?

  26. 26

    1Password처럼 Phonegap 앱에서 외부 양식 채우기

  27. 27

    how to remove bottom space in windows phone phonegap?

  28. 28

    how to give id dynamically to an element in phonegap?

  29. 29

    phonegap + jqmobile: how to change page correctly

뜨겁다태그

보관