Code Button Back

lock255

Well-Known Member
Licensed User
Longtime User
Hello I'm looking for the code to perform the equivalent of the Back button.
Can anyone help me?
 

lock255

Well-Known Member
Licensed User
Longtime User
I have a textbox, after I wrote in the text I press the enter button to contine the code that simulates the back button, so the keyboard closes.
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
I am trying this and do not get a 'Done' button appearing on the text keyboard?

B4X:
edtPrice.ForceDoneButton = True
txtName.ForceDoneButton = True

The top one edtPrice displays a Done button, the next one doesn't?

Any ideas anyone?

Cheers,

Malky
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Hi Erel, I don't have a layout loaded in the app?

It appears to be initialised in the same part as the previous text edit (price) component?

The only difference I can see between the two is that the previous one has a sub (Sub edtPrice_EnterPressed ), which I copied and renamed to suit the text box, but still no 'Done' button?

Malky
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
B4X:
    edtPrice.ForceDoneButton = True
    txtName.ForceDoneButton = True
I can't see anything? Maybe getting tunnel vision?

In Globals
B4X:
    Dim edtPrice As EditText
    Dim txtName As EditText

In Activity_Create
B4X:
    edtPrice.Initialize("edtPrice")
    txtName.Initialize("txtName")

In the display sub
B4X:
    edtPrice.ForceDoneButton = True
    txtName.ForceDoneButton = True

They seem the same to me except that the edtprice component is set to number only?

Malky
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Strange, I set the type to text only and it now works?

B4X:
txtName.InputType =txtName.INPUT_TYPE_TEXT

Oh well, I'm happy. Just in case anyone else has the same problem?

Malky
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…