native Text Field using inputType on android

im using native.newTextField()

and using object.inputType

http://docs.coronalabs.com/daily/api/type/TextField/inputType.html

it works perfectly on IOS, but on Android it doesnt work.

it always show the default keyboard on android.

my corona version is  2014.2393 (2014.8.5)    and im using on mac.

any help?

Hi @2creativegames,

Just for reference, can you please post your code where you create the input field and its associated properties?

Thanks,

Brent

textField = native.newTextField( 0, 0, 447, tHeight )

textField.inputType = “number”

it works on IOS but not on ANDROID.

thank you for your reply. =D

Have you tried our SampleCode/Interface/NativeKeyboard sample app?

Rob

Hi, i used the sample code to build my own code.

here is my code.

local function criaTextField()

textField = native.newTextField( 0, 0, 447, tHeight )

textField.posicao = 1

textField.x = centroX -4

textField.y = centroY - 75

textField.inputType = “number”

textField.align = “right”

textField.size = inputFontSize

textField.isSecure = false

textField.hasBackground = false

textField:setTextColor( corRosa[1] , corRosa[2] , corRosa[3]  )

textField:addEventListener( “userInput”, textos )

end

the funny thing is that the  - inputType =“number”  -  works on IOS but not on android.

Please actually build and install the sample app on your device.  I just did that on my Google Nexus 7 and when I tap on the “Number” field, I get a “Number” keyboard.

From that there are one of two possibilities (okay 3, I’m using the latest daily build and there is a possibility a bug was fixed, but I don’t remember any fixes in this area.)

  1. There is something odd with your device your testing on. 

  2. You’re doing something different than the sample app is doing.

Rob

for some reason this line of code

textField.isSecure = false

bugs the inputType on android.

to solve the problem i had to delete this line of code.

thank you for your help.

Can I get you to file a bug report on this?

Thanks

Rob

Hi @2creativegames,

Just for reference, can you please post your code where you create the input field and its associated properties?

Thanks,

Brent

textField = native.newTextField( 0, 0, 447, tHeight )

textField.inputType = “number”

it works on IOS but not on ANDROID.

thank you for your reply. =D

Have you tried our SampleCode/Interface/NativeKeyboard sample app?

Rob

Hi, i used the sample code to build my own code.

here is my code.

local function criaTextField()

textField = native.newTextField( 0, 0, 447, tHeight )

textField.posicao = 1

textField.x = centroX -4

textField.y = centroY - 75

textField.inputType = “number”

textField.align = “right”

textField.size = inputFontSize

textField.isSecure = false

textField.hasBackground = false

textField:setTextColor( corRosa[1] , corRosa[2] , corRosa[3]  )

textField:addEventListener( “userInput”, textos )

end

the funny thing is that the  - inputType =“number”  -  works on IOS but not on android.

Please actually build and install the sample app on your device.  I just did that on my Google Nexus 7 and when I tap on the “Number” field, I get a “Number” keyboard.

From that there are one of two possibilities (okay 3, I’m using the latest daily build and there is a possibility a bug was fixed, but I don’t remember any fixes in this area.)

  1. There is something odd with your device your testing on. 

  2. You’re doing something different than the sample app is doing.

Rob

for some reason this line of code

textField.isSecure = false

bugs the inputType on android.

to solve the problem i had to delete this line of code.

thank you for your help.

Can I get you to file a bug report on this?

Thanks

Rob

Hi Rob,
I would be glad if you solve this problem early.

Thanks.

I just looked through the open bugs.  I don’t see where any one on this thread posted the requested bug report.  However, that said, there is a similar bug report.  That bug report says the order matters, which means that there is a work around and while we will fix it eventually, it’s not a high priority bug.

The Work around is to specify the keyboard type before you specify the .isSecure flag.

Please give that a try and see if it works around the problems for you. 

Rob

>The Work around is to specify the keyboard type before you specify the .isSecure flag.

When that way, the inputType works fine, But the isSecure flag do not work on android…

Hi Rob,
I would be glad if you solve this problem early.

Thanks.

I just looked through the open bugs.  I don’t see where any one on this thread posted the requested bug report.  However, that said, there is a similar bug report.  That bug report says the order matters, which means that there is a work around and while we will fix it eventually, it’s not a high priority bug.

The Work around is to specify the keyboard type before you specify the .isSecure flag.

Please give that a try and see if it works around the problems for you. 

Rob