Fausto Loss Member Licensed User Nov 17, 2016 #1 Hi, I want to have an Edit Text with a Character limit of 20. So after 20 characters have been entered, stop the typing. Code: Dim IME As IME Dim edtTest As EditText edtTest.Initialize("") IME.Initialize("") IME.SetLengthFilter(edtTest, 20) I've tried using the above code inside Activity_Create. I load librarie IME. But nothing happened .... did not introduce an error nor did it prevent the typing. thanks
Hi, I want to have an Edit Text with a Character limit of 20. So after 20 characters have been entered, stop the typing. Code: Dim IME As IME Dim edtTest As EditText edtTest.Initialize("") IME.Initialize("") IME.SetLengthFilter(edtTest, 20) I've tried using the above code inside Activity_Create. I load librarie IME. But nothing happened .... did not introduce an error nor did it prevent the typing. thanks
M Mahares Expert Licensed User Longtime User Nov 17, 2016 #2 If you have the edit text created in the Designer, do not initialize it. That is why you are getting nothing. The below code works. Code: Sub Globals Dim IME As IME Dim edtTest As EditText End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("layout1") edtTest.Color=Colors.Red IME.Initialize("IME") IME.SetLengthFilter(edtTest, 20) End Sub Upvote 0
If you have the edit text created in the Designer, do not initialize it. That is why you are getting nothing. The below code works. Code: Sub Globals Dim IME As IME Dim edtTest As EditText End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("layout1") edtTest.Color=Colors.Red IME.Initialize("IME") IME.SetLengthFilter(edtTest, 20) End Sub