I have some EditTexts on my android app to get float numbers, I need to use a numeric keypad and I am using android:inputType=“phone” on the layout-xml, so this gave me the phone keyboard, but to access the “.” the user must do an extra step to get it.
Before I start to create a custom keyboard ( I got some tutorials about this ), I want to try to replace the “*” to “.”, so I could try this solution.
Public
method afterTextChanged(s: android.text.Editable);
implementation
method RomaneioEntProdutosItens.afterTextChanged(s: android.text.Editable);
begin
var doubleValue: Double := 0;
if (s <> nil) then begin
try
doubleValue := Double.parseDouble(s.toString().replace(’*’, ‘.’));
except
end
end
end;
var edtLarg: EditText := EditText(findViewById(R.id.ed_largura));
edtLarg.OnTextChangedListener := new interface EditText.OnTextChangedListener( OnTextChangedListener := @afterTextChanged );
I am having this error on the last line above.
Error 13 (E28) Unknown type “EditText.OnTextChangedListener” RomaneioEntProdutosItens.pas 118 50 Absolut.coletor.producao
I think it should by edtLarg.addTextChangedListener( );
Any idea?
Thanks in advance,
José Carlos.