Allowing the User to Enter a Comma-Delimited List of Integers in EditText

Nathan Sokalski 4,126 Reputation points
2022-03-07T02:24:42.033+00:00

I have an EditText in which I want to allow the user to enter a list of integers delimited by commas (and/or spaces, or even some other character if that would be easier). However, using things like android:inputType="number" and android:numeric="integer" do not seem to allow the user to enter commas. Is there a good way to allow entry of a (usually short, around 5) list of small integers? I can (and will) obviously manually parse the string, and I can of course use TextChanged to remove invalid characters as they type, but I would like to display the most appropriate & intuitive keyboard for the scenario.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,326 questions
{count} votes