anallie0 Active Member Licensed User Longtime User Jan 5, 2014 #1 I'm using the example of SearchView but I have two errors: I added the input box in a panel, but when I press the delete key and the input box is empty, the app closes. is indicated that IME is an uninitialized variable, but it is a library The entire project is here: https://www.mediafire.com/?mrc1na8qbrtib3g Attachments screen1.png 7.7 KB · Views: 350 uscita.png 3.5 KB · Views: 464
I'm using the example of SearchView but I have two errors: I added the input box in a panel, but when I press the delete key and the input box is empty, the app closes. is indicated that IME is an uninitialized variable, but it is a library The entire project is here: https://www.mediafire.com/?mrc1na8qbrtib3g
LucaMs Expert Licensed User Longtime User Jan 5, 2014 #2 Great hint: init IME with a parameter for events (I have never used SearchView) Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2014 #3 You should initialize IME variable. Though this is not the cause of the error. You should check the logs and post the error message. Upvote 0
You should initialize IME variable. Though this is not the cause of the error. You should check the logs and post the error message.
anallie0 Active Member Licensed User Longtime User Jan 5, 2014 #4 Hi Erel, I copied exactly your example by adding the imputbox in a panel. if the imputbox is empty and I press the delete key on the keyboard, the Activity closes. There are no error messages if no one in the attached image. Upvote 0
Hi Erel, I copied exactly your example by adding the imputbox in a panel. if the imputbox is empty and I press the delete key on the keyboard, the Activity closes. There are no error messages if no one in the attached image.
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2014 #5 Pressing on the back key will close the activity (when the keyboard is closed). Upvote 0
anallie0 Active Member Licensed User Longtime User Jan 5, 2014 #6 Maybe I can not explain. I am attaching a picture. when the textbox is empty and press the delete key (marked in red) the app closes. in the Logs panel i see ** Activity (main) Pause, UserClosed=true ** Attachments Screenshot_2014-01-05-17-15-26.png 55.7 KB · Views: 402 Last edited: Jan 5, 2014 Upvote 0
Maybe I can not explain. I am attaching a picture. when the textbox is empty and press the delete key (marked in red) the app closes. in the Logs panel i see ** Activity (main) Pause, UserClosed=true **
LucaMs Expert Licensed User Longtime User Jan 5, 2014 #7 I have now tried the class SearchView. I modified only 3 lines in the example, putting "sv" in a panel and everything is ok, clicking on "delete" when the edittext is empty too. (sbaglio o sei italiano e mi fai fare una gran fatica? . Come non detto, sei italiano e forse te lo avevo anche già chiesto) Code: Copy Sub Activity_Create(FirstTime As Boolean) pnl.Initialize("pnl") Activity.AddView(pnl, 0,0, 100%x, 100%y) sv.Initialize(Me, "sv") sv.AddToParent(pnl, 0, 0, 200dip, 300dip) STOP! I'm not used IME!... I'll try again Countermand: the IME is already in the example Last edited: Jan 5, 2014 Upvote 0
I have now tried the class SearchView. I modified only 3 lines in the example, putting "sv" in a panel and everything is ok, clicking on "delete" when the edittext is empty too. (sbaglio o sei italiano e mi fai fare una gran fatica? . Come non detto, sei italiano e forse te lo avevo anche già chiesto) Code: Copy Sub Activity_Create(FirstTime As Boolean) pnl.Initialize("pnl") Activity.AddView(pnl, 0,0, 100%x, 100%y) sv.Initialize(Me, "sv") sv.AddToParent(pnl, 0, 0, 200dip, 300dip) STOP! I'm not used IME!... I'll try again Countermand: the IME is already in the example
anallie0 Active Member Licensed User Longtime User Jan 5, 2014 #8 LucaMs il mio pannello l'ho messo da design ma si chiude anche l'app e non riesco a capire perchè. Code: Copy panelcerca.SetLayout(0%x, 0%y, 100%x, 100%y) sv.Initialize(Me, "sv") sv.AddToParent(panelcerca, 0%x, 0%y, 100%x, 70%y) Upvote 0
LucaMs il mio pannello l'ho messo da design ma si chiude anche l'app e non riesco a capire perchè. Code: Copy panelcerca.SetLayout(0%x, 0%y, 100%x, 100%y) sv.Initialize(Me, "sv") sv.AddToParent(panelcerca, 0%x, 0%y, 100%x, 70%y)
LucaMs Expert Licensed User Longtime User Jan 5, 2014 #9 anallie0 said: LucaMs il mio pannello l'ho messo da design ma si chiude anche l'app e non riesco a capire perchè. Code: Copy panelcerca.SetLayout(0%x, 0%y, 100%x, 100%y) sv.Initialize(Me, "sv") sv.AddToParent(panelcerca, 0%x, 0%y, 100%x, 70%y) Click to expand... Uhm non mi sembra che quella classe sia fatta per metterla nel designer, ma l'ho guardata al volo. Riprovo (cioè, non così com'è!) Upvote 0
anallie0 said: LucaMs il mio pannello l'ho messo da design ma si chiude anche l'app e non riesco a capire perchè. Code: Copy panelcerca.SetLayout(0%x, 0%y, 100%x, 100%y) sv.Initialize(Me, "sv") sv.AddToParent(panelcerca, 0%x, 0%y, 100%x, 70%y) Click to expand... Uhm non mi sembra che quella classe sia fatta per metterla nel designer, ma l'ho guardata al volo. Riprovo (cioè, non così com'è!)
LucaMs Expert Licensed User Longtime User Jan 5, 2014 #10 Si, come dicevo, quella classe non è pronta per essere un Custom View. Quindi, l'avrai adattata, per metterla da Designer, giusto? Il problema è sicuramente là... ora provo a tradurre, perché non siamo nel forum italiano To use that class in the designer you surely have adapted it for this purpose. The problem must be in that part of the code. Upvote 0
Si, come dicevo, quella classe non è pronta per essere un Custom View. Quindi, l'avrai adattata, per metterla da Designer, giusto? Il problema è sicuramente là... ora provo a tradurre, perché non siamo nel forum italiano To use that class in the designer you surely have adapted it for this purpose. The problem must be in that part of the code.
anallie0 Active Member Licensed User Longtime User Jan 5, 2014 #11 se hai voglia e tempo ho allegato l'intero progetto se vuoi dagli un occhio.... ho messo solo il Panel con il design poi ho aggiunto la classe da codice I only put the panel with the design then I added the code from class Upvote 0
se hai voglia e tempo ho allegato l'intero progetto se vuoi dagli un occhio.... ho messo solo il Panel con il design poi ho aggiunto la classe da codice I only put the panel with the design then I added the code from class
LucaMs Expert Licensed User Longtime User Jan 5, 2014 #12 anallie0 said: se hai voglia e tempo ho allegato l'intero progetto se vuoi dagli un occhio.... Click to expand... beh, glielo presto, al massimo, hehehe Upvote 0
anallie0 said: se hai voglia e tempo ho allegato l'intero progetto se vuoi dagli un occhio.... Click to expand... beh, glielo presto, al massimo, hehehe
LucaMs Expert Licensed User Longtime User Jan 5, 2014 #13 Il codice del tasto "Delete" è 67, non è KeyCodes.KEYCODE_BACK = 4, per questo ti esce. Ti basta aggiungere un "Or keycode = 67" (se usi: Code: Copy Select Case KeyCode Case KeyCodes.KEYCODE_... Case KeyCodes.KEYCODE_... End Select è meglio) Your code does not intercepted pressing the button that has a code different from the one you expected Upvote 0
Il codice del tasto "Delete" è 67, non è KeyCodes.KEYCODE_BACK = 4, per questo ti esce. Ti basta aggiungere un "Or keycode = 67" (se usi: Code: Copy Select Case KeyCode Case KeyCodes.KEYCODE_... Case KeyCodes.KEYCODE_... End Select è meglio) Your code does not intercepted pressing the button that has a code different from the one you expected
LucaMs Expert Licensed User Longtime User Jan 5, 2014 #14 Così è meglio (anche se non è perfetta) Code: Copy Sub Activity_KeyPress (KeyCode As Int) As Boolean Select Case KeyCode Case KeyCodes.KEYCODE_MENU, _ KeyCodes.KEYCODE_VOLUME_DOWN, _ KeyCodes.KEYCODE_VOLUME_UP, _ KeyCodes.KEYCODE_DEL Return True Case KeyCodes.KEYCODE_BACK If panelcerca.Visible = True Then panelcerca.Visible=False Return True End If If panelconsulta.Visible = True Then panelconsulta.Visible=False 'lista.SetSelection(0) Return True End If If panellista.Visible = True Then panellista.Visible=False lista.SetSelection(0) Return True End If Case Else Activity.finish End Select End Sub P.S. dovrei andare a farmele, saranno come minimo 20 anni che non vado, hehehe Upvote 0
Così è meglio (anche se non è perfetta) Code: Copy Sub Activity_KeyPress (KeyCode As Int) As Boolean Select Case KeyCode Case KeyCodes.KEYCODE_MENU, _ KeyCodes.KEYCODE_VOLUME_DOWN, _ KeyCodes.KEYCODE_VOLUME_UP, _ KeyCodes.KEYCODE_DEL Return True Case KeyCodes.KEYCODE_BACK If panelcerca.Visible = True Then panelcerca.Visible=False Return True End If If panelconsulta.Visible = True Then panelconsulta.Visible=False 'lista.SetSelection(0) Return True End If If panellista.Visible = True Then panellista.Visible=False lista.SetSelection(0) Return True End If Case Else Activity.finish End Select End Sub P.S. dovrei andare a farmele, saranno come minimo 20 anni che non vado, hehehe
anallie0 Active Member Licensed User Longtime User Jan 5, 2014 #15 grazie mille LucaMs, non pensavo che il tasto del della tastiera venisse intercettato dall'activity. Upvote 0
LucaMs Expert Licensed User Longtime User Jan 5, 2014 #16 anallie0 said: grazie mille LucaMs, non pensavo che il tasto del della tastiera venisse intercettato dall'activity. Click to expand... Non c'è di che (neanch'io hehehe)... basta eseguire il programma step by step con F8 e trovi l'errore, di solito. Upvote 0
anallie0 said: grazie mille LucaMs, non pensavo che il tasto del della tastiera venisse intercettato dall'activity. Click to expand... Non c'è di che (neanch'io hehehe)... basta eseguire il programma step by step con F8 e trovi l'errore, di solito.