dbachelder / CreditCardEntry

Smooth UI for Credit Card Entry on Android device, regex check for supported credit card types and luhn check. Inspired by Square credit card entry interface
MIT License
503 stars 166 forks source link

Backspace not working on android 5.0.2 #29

Closed manuelsilverio closed 9 years ago

manuelsilverio commented 9 years ago

When typing a card number on android 5.0.2 I am unable to delete it.

dbachelder commented 9 years ago

I can't reproduce. Do you have a sample project to demo the problem? Does the sample app work for you?

manuelsilverio commented 9 years ago

Hi I solved the issue already apparently this is a common problem. A bit complicated to explain. To make to story short the bug is in android itself so you have to create you own Input connection instead of using android's default one. This problem depends also on the keyboard inputIME you phone is using (apparently).

The problem is solved here: http://stackoverflow.com/questions/18581636/android-cannot-capture-backspace-delete-press-in-soft-keyboard/19980975#19980975

Just skip all the explanations and copy and paste the tow classes:

InputConnectionAccomodatingLatinIMETypeNullIssues EditableAccomodatingLatinIMETypeNullIssues

then implement InputConnectionAccomodatingLatinIMETypeNullIssues in the onCreateInputConnection override and done. I renamed my Input connection InputConnectionNullIssues. Remenber to give values of (this, false) to the Input connection.

oncreateinputcon

dbachelder commented 9 years ago

Wow... thanks for the info! That's a crappy bug!