More native field problems...

Like in my previous post, I explained I made some workaround for iOS, which is about the keyboard overlapping the native field. This workaround includes separate screen with only one native field (in the upper side of the screen). When the user finishes entering the text, I show the form page (which was hidden by the single-field screen for the time entering the text).

So, on samsung galaxy tab the form page sometimes won't return to normal. (It will stay one keyboard higher than usual). And it will crash after this.
When opening the keyboard on the single-field screen, the native field won't move, but the other objects (one text field and another button for going back to the form page) will go up and be above the visible area of the screen.

On Htc desire I don't experience screen position problems. But when I'm going back to the form (which includes hiding the single-field screen, hiding the keyboard and showing the form page again) sometimes the app just plain closes.

PLEASE GIVE SOME FEEDBACK ABOUT THIS. I want to know if Corona is FAMILIAR WITH THESE ISSUES, whether or not this is worked on, and if it will be fixed in the following week (or two). Or if I'm doing something wrong! This really is bringing my confidence in the product down.

Here's my single-field screen source:

bg_ = nil
field = nil
nameLabel = nil
doneButton = nil
callback = nil

function closeScreen()
native.setKeyboardFocus( nil )

bg_:removeSelf()
if field then
field:removeSelf()
end
nameLabel:removeSelf()
doneButton:removeSelf()

--callback("fdsfsafsdfdsf")
callback(field.text)
end

function endFieldEditBtn( event )
if ( event.phase == "ended" ) then
closeScreen()
end
return true
end

function endFieldEdit( event )
-- Hide keyboard when the user clicks "Return" in this field
if (event and event.phase) then
if ( "submitted" == event.phase or "ended" == event.phase ) then
closeScreen()
return true
end
end
end

function bgNoMethod()
return true
end

function startFieldEdit(text, name, callback_, inputType)
print ("start field edit: " .. name )
bg_ = display.newRect(0, 0, display.stageWidth, display.stageHeight)
bg_:setFillColor(20, 60, 18)
bg_:toFront()
bg_:addEventListener("touch", bgNoMethod)

nameLabel = display.newText( "", 200, 50, "Helvetica", 22 )
nameLabel.text = name
nameLabel:setTextColor( 255, 255, 255, 255 )
nameLabel:toFront()

local fH = 38
if (PLATFORM_ID == 2) then
fH = 50
end
field = native.newTextField( 100, 130, 200, fH, endFieldEdit)
field.text = text
if (inputType) then
field.inputType = inputType
end
--native.setKeyboardFocus( field )

doneButton = display.newImageRect('back.png',75,15)
--display.newRect( 150, 130, 100, 40)
doneButton.x = display.stageWidth/2
doneButton.y = 220
doneButton:addEventListener("touch", endFieldEditBtn)
doneButton:toFront()

callback = callback_
end

Here is the log (I've replaced my client's name with dots):

09-02 11:53:34.466: INFO/DEBUG(1229): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-02 11:53:34.466: INFO/DEBUG(1229): Build fingerprint: 'htc_wwe/htc_ace/ace:2.3.3/GRI40/87995:user/release-keys'
09-02 11:53:34.466: INFO/DEBUG(1229): pid: 20789, tid: 20799 >>> com.....mobilegame <<<
09-02 11:53:34.466: INFO/DEBUG(1229): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000029
09-02 11:53:34.466: INFO/DEBUG(1229): r0 00000029 r1 4594db3c r2 00000000 r3 8092c970
09-02 11:53:34.466: INFO/DEBUG(1229): r4 4594db3c r5 4594db3c r6 00000029 r7 00000029
09-02 11:53:34.466: INFO/DEBUG(1229): r8 4594db64 r9 809065cc 10 4559eeb8 fp 800a73d4
09-02 11:53:34.466: INFO/DEBUG(1229): ip 00000000 sp 4594db20 lr 808f0200 pc 808d00ec cpsr 20000010
09-02 11:53:34.466: INFO/DEBUG(1229): d0 4236354840537c01 d1 0000000000000002
09-02 11:53:34.466: INFO/DEBUG(1229): d2 0000000000000000 d3 ffffffff00000000
09-02 11:53:34.466: INFO/DEBUG(1229): d4 0000000000001c07 d5 0000043f00890000
09-02 11:53:34.466: INFO/DEBUG(1229): d6 0000000000000000 d7 0000000000000008
09-02 11:53:34.466: INFO/DEBUG(1229): d8 000000000000011e d9 0000000000000000
09-02 11:53:34.466: INFO/DEBUG(1229): d10 0000000000000000 d11 0000000000000000
09-02 11:53:34.466: INFO/DEBUG(1229): d12 0000000000000000 d13 0000000000000000
09-02 11:53:34.466: INFO/DEBUG(1229): d14 0000000000000000 d15 0000000000000000
09-02 11:53:34.466: INFO/DEBUG(1229): d16 00342e7840537e80 d17 3fe0000000000000
09-02 11:53:34.466: INFO/DEBUG(1229): d18 3fff8def8808b024 d19 465aa3f469f40e1c
09-02 11:53:34.466: INFO/DEBUG(1229): d20 3fe3333340000000 d21 3fd3333340000000
09-02 11:53:34.466: INFO/DEBUG(1229): d22 3fd51eb860000000 d23 40e01d100abe0000
09-02 11:53:34.466: INFO/DEBUG(1229): d24 40dd4c2013880000 d25 40ed4c1013880000
09-02 11:53:34.466: INFO/DEBUG(1229): d26 40cd4c4013880000 d27 bf9d909e6e44e32e
09-02 11:53:34.466: INFO/DEBUG(1229): d28 bffc7208aec70c36 d29 3fcd9303fea2f7cc
09-02 11:53:34.466: INFO/DEBUG(1229): d30 3c37acd6d7860f0c d31 3e6d3bc1f3000000
09-02 11:53:34.466: INFO/DEBUG(1229): scr 20000013
09-02 11:53:34.516: INFO/DEBUG(1229): #00 pc 000d00ec /data/data/com.....mobilegame/lib/libcorona.so
09-02 11:53:34.516: INFO/DEBUG(1229): #01 pc 000f01fc /data/data/com.....mobilegame/lib/libcorona.so
09-02 11:53:34.516: INFO/DEBUG(1229): #02 pc 000db608 /data/data/com.....mobilegame/lib/libcorona.so
09-02 11:53:34.516: INFO/DEBUG(1229): #03 pc 00018174 /system/lib/libdvm.so
09-02 11:53:34.516: INFO/DEBUG(1229): code around pc:
09-02 11:53:34.516: INFO/DEBUG(1229): 808d00cc e5802000 e8bd8010 e3a02000 e5802000
09-02 11:53:34.516: INFO/DEBUG(1229): 808d00dc e12fff1e e3a02000 e5802000 e12fff1e
09-02 11:53:34.516: INFO/DEBUG(1229): 808d00ec e5903000 e5d30000 e2700001 33a00000
09-02 11:53:34.516: INFO/DEBUG(1229): 808d00fc e12fff1e e5903000 e5932000 e38220ff
09-02 11:53:34.516: INFO/DEBUG(1229): 808d010c e5832000 e12fff1e e3510000 e5801000
09-02 11:53:34.516: INFO/DEBUG(1229): code around lr:
09-02 11:53:34.516: INFO/DEBUG(1229): 808f01e0 e1a00005 e3e01001 ebfd5738 eaffffef
09-02 11:53:34.516: INFO/DEBUG(1229): 808f01f0 e92d4070 e1a04001 e1a06000 ebff7fba
09-02 11:53:34.516: INFO/DEBUG(1229): 808f0200 e3500000 0a000013 e5965004 e3550000
09-02 11:53:34.516: INFO/DEBUG(1229): 808f0210 0a000010 e5943000 e1a00004 e1a0e00f
09-02 11:53:34.516: INFO/DEBUG(1229): 808f0220 e593f000 e1a01005 e1a02000 e1a00006
09-02 11:53:34.516: INFO/DEBUG(1229): stack:
09-02 11:53:34.516: INFO/DEBUG(1229): 4594dae0 00000000
09-02 11:53:34.516: INFO/DEBUG(1229): 4594dae4 80075fdf /system/lib/libdvm.so
09-02 11:53:34.516: INFO/DEBUG(1229): 4594dae8 00000000
09-02 11:53:34.516: INFO/DEBUG(1229): 4594daec 00000000
09-02 11:53:34.516: INFO/DEBUG(1229): 4594daf0 00000004
09-02 11:53:34.516: INFO/DEBUG(1229): 4594daf4 0000001f
09-02 11:53:34.516: INFO/DEBUG(1229): 4594daf8 455cb7d0
09-02 11:53:34.516: INFO/DEBUG(1229): 4594dafc 00001000
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db00 00000000
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db04 00000000
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db08 00000001
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db0c 00000002
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db10 00000003
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db14 800a7678
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db18 df002777
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db1c e3a070ad
09-02 11:53:34.526: INFO/DEBUG(1229): #01 4594db20 8092de38
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db24 4594db3c
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db28 000004d0
09-02 11:53:34.526: INFO/DEBUG(1229): 4594db2c 808db60c /data/data/com.....mobilegame/lib/libcorona.so
09-02 11:53:35.137: INFO/BootReceiver(1330): Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)
09-02 11:53:35.167: INFO/AudioPolicyManagerBase(1232): setOutputDevice() output 1 device 0 delayMs 0
09-02 11:53:35.167: INFO/AudioPolicyManagerBase(1232): setOutputDevice() setting same device 0 or null device for output 1

09-02 11:53:35.167: ERROR/InputDispatcher(1330): channel '40bb8860 com.....mobilegame/com........MyCoronaActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8
09-02 11:53:35.167: ERROR/InputDispatcher(1330): channel '40bb8860 com.....mobilegame/com........MyCoronaActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

UPDATE: I think that the crashing is caused by this:

native.setKeyboardFocus( nil )

views:2057 update:2011/10/7 17:24:19
corona forums © 2003-2011