0

In my app Edit view allow only the Capital letters, Numbers and hyphen. So I had a filter for that like

char[] acceptedChars = new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
            '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-'};
 mEnterRecordername.setFilters(new InputFilter[]{filter, filterArray});

In this case, is it possible to show filter characters only in the soft key?

thiru
  • 45
  • 1
  • 6
  • 3
    That's not possible. You just filter the characters but not hide them. If you want to achieve this then you have to create your own Soft Keyboard. – Md. Asaduzzaman Jan 06 '20 at 10:47
  • @Md. Asaduzzaman - Please can you share any doc to create own soft key? – thiru Jan 06 '20 at 10:50
  • 1
    https://www.androidauthority.com/lets-build-custom-keyboard-android-832362/ or https://medium.com/@ssaurel/creating-an-in-app-keyboard-for-your-android-apps-a0a6c6e1e289 or https://stackoverflow.com/questions/9577304/how-can-you-make-a-custom-keyboard-in-android – Md. Asaduzzaman Jan 06 '20 at 10:53
  • 1
    you can creat a soft key by yourself, it's just a layout – Hoàng Vũ Anh Jan 06 '20 at 10:54
  • I have done by the below link (https://www.ssaurel.com/blog/learn-to-create-a-system-keyboard-on-android/) But it's not reflecting. I have register service in the manifest file. is need to set inputType for the edit view? – thiru Jan 06 '20 at 12:14

0 Answers0