Weird issues with AutocompleteEditText View and IME

Roger Garstang

Well-Known Member
Licensed User
Longtime User
I use the IME library to process the Next button on the keyboard and navigate to the next control in a list. I just make all views Autocomplete even if no items for the popup list. Navigation to the next control works fine unless there are items assigned for the list. On Gingerbread and Honeycomb devices when I press Next in the control containing items for the autocomplete list it jumps focus twice past the next control to the one after then hangs. The Keyboard stays open between focus changes (By Design) so it usually stays drawn even if Im able to Force Close. The phone/tablet continues to get further unstable and often crashes the Launcher/Home Screen, etc. On Android 4.0 it works fine and navigates the views properly.
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
Not really helpful from what I can see, it is like hitting next causes some endless loop of Extracting text. I don't do anything with text at that point and I didn't even type anything...just hit next to go to next control. I pulled the device to stop the never ending stream at the end and still had to trim some off the bottom to fit here.

** Activity (cases) Resume **
Displayed com.primarymarking.etwist/.cases: +466ms
GC_EXPLICIT freed 57K, 48% free 3054K/5831K, external 6634K/8197K, paused 58ms
Starting: Intent { flg=0x20000 cmp=com.primarymarking.etwist/.caseedit } from pid 17663
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@406b16c0
** Activity (cases) Pause, UserClosed = false **
** Activity (caseedit) Create, isFirst = true **
ignoring event: edit_textchanged
ignoring event: edit_textchanged
ignoring event: edit_textchanged
New activity, p= com.primarymarking.etwist a=com.primarymarking.etwist.caseedit
Corresponding profile id: 1
ignoring event: edit_textchanged
ignoring event: edit_textchanged
ignoring event: edit_textchanged
ignoring event: edit_textchanged
ignoring event: edit_textchanged
ignoring event: edit_textchanged
ignoring event: edit_textchanged
ignoring event: edit_textchanged
ignoring event: edit_textchanged
** Activity (caseedit) Resume **
Displayed com.primarymarking.etwist/.caseedit: +442ms


GC_EXTERNAL_ALLOC freed 38K, 57% free 4646K/10567K, external 8108K/8516K, paused 101ms
GC_EXTERNAL_ALLOC freed 32K, 57% free 4646K/10567K, external 8108K/8516K, paused 107ms
GC_EXTERNAL_ALLOC freed 30K, 57% free 4646K/10567K, external 8108K/8516K, paused 97ms
GC_CONCURRENT freed 760K, 49% free 3486K/6727K, external 3580K/4000K, paused 2ms+4ms
GC_EXPLICIT freed 426K, 50% free 4729K/9415K, external 4402K/5497K, paused 57ms
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@408edf98
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@40650a10
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@40759228
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@408634a8
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@4066af88
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@406460b0
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@40738430
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@40652cf8
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@4074a038
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@405f7698
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection


getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@406c3e98
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
GC_EXPLICIT freed 295K, 56% free 4719K/10567K, external 8108K/8516K, paused 109ms
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@406de158
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@40974d38
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@4090b3a0
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@408dab28
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@408a0f28
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@4081b5d8
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@407805a8
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@40713ad8
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@4069c450
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@40560210


finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@406aae90
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@4059c350
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@40749518
finishComposingText on inactive InputConnection
getExtractedText on inactive InputConnection
GC_EXPLICIT freed 423K, 51% free 3335K/6727K, external 3487K/4000K, paused 30ms
GC_EXPLICIT freed 155K, 51% free 4694K/9415K, external 4402K/5497K, paused 41ms
getCursorCapsMode on inactive InputConnection
getExtractedText on inactive InputConnection
getExtractedText on inactive InputConnection
Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@405d7898
finishComposingText on inactive InputConnection
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
I've been trying to get the same failure in a smaller app doing something similar, but I can't get it to freeze. Code I've tried is below and works fine, but real code is more complicated...I'm going to see if I can debug more and see where exactly it is when these crazy loops are going. So, what exactly does the AutoComplete boxes do with the action...or any other differences they have that Plain Edits don't do that could cause issues?

I made them all AutoComplete just to have a base control to work with that does it all. It appears in every way to be just like a Plain edit other than the list, so I figured it wouldn't hurt to just have it available. So far this is the first screen I've needed the list in because for Case Types there are a few hundred possible values. The values begin with a number followed by a description. Using a Spinner/Combobox or Listview involves too much scrolling. The Autocomplete functionality is perfect for this. The user types "Robbery" and the list pops up showing the 4-5 values containing that word, or they can start typing the number and it is filtered to it and they can select the one they need. It works kind of like a Windows Combobox that you can type in only with better item matching.

B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim textboxes(3) As AutoCompleteEditText
   Dim IME As IME
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim ref As Reflector

   IME.Initialize("IME")
   For i= 0 To 2
      textboxes(i).Initialize("")
      textboxes(i).TextSize= 18
      IME.AddHandleActionEvent(textboxes(i))
      ref.Target = textboxes(i)
      ref.RunMethod2("setImeOptions", Bit.Or(268435456, 5), "java.lang.int") 'flagNoExtractUi= 268435456, Next Button= 5
      If i = 1 Then
         textboxes(i).SetItems(Array As String("ABC", "123", "DEF", "456"))
      End If
      Activity.AddView(textboxes(i), 5dip, i * 50dip + 5dip, 100%x - 10dip, 50dip)
   Next
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Private Sub IME_HandleAction As Boolean
   Select Case Sender
      Case textboxes(0)
         textboxes(1).RequestFocus
      Case textboxes(1)
         textboxes(2).RequestFocus
      Case textboxes(2)
         textboxes(0).RequestFocus
   End Select
End Sub
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
It appears to be a combination of a few things. I was under the impression that returning false in the IME HandleAction closed the keyboard, so when an Edit/Autocomplete View got focus I was showing the keyboard. Showing the keyboard seems to be what caused it to blow up. After removing that it no longer froze and the keyboard stayed open. I had modified this to allow for showing the autocomplete list when a view that already had focus got focus again and not have the keyboard in the way. (Tap Twice or on a Label that I had set focus to an Edit View and it would show the list)

From the documentation I had gathered that the return value only controlled the keyboard state which it appears it really has nothing to do with. The return value is more of a stop point more like Windows message loops in that returning True doesn't pass it along for default processing. Returning True allows me to control navigation and returning False allows Android to navigate (Which for the most part went to the same controls except in that one location).

Returning True keeps it how I expect it and the keyboard honors the action buttons and View Input Types...not the Return Value. I'm guessing since my focus changes were the same as Android's the showing keyboard on focus worked fine, but when I focused to my next in line and Android focused to a different one there must have been some endless loop condition internally.
 
Last edited:
Top