Problem with codename and Android

58 views
Skip to first unread message

Guilherme Motta

unread,
Nov 27, 2013, 9:54:28 AM11/27/13
to codenameone...@googlegroups.com
Hello, my code runs perfectly in my computer but in android I have this error: "javal.lang.ClassException:com.codename1.ui.TextArea"
I don't know what's happening =/

Guilherme Motta

unread,
Nov 27, 2013, 10:46:41 AM11/27/13
to codenameone...@googlegroups.com


Em quarta-feira, 27 de novembro de 2013 12h54min28s UTC-2, Guilherme Motta escreveu:
Hello, my code runs perfectly in my computer but in android I have this error: "javal.lang.ClassException:com.codename1.ui.TextArea"
I don't know what's happening =/

Rectifying... The error is "javal.lang.ClassCastException:com.codename1.ui.TextArea" 

Shai Almog

unread,
Nov 27, 2013, 2:39:11 PM11/27/13
to codenameone...@googlegroups.com
Where do you get that exception?
What do you do in the area of the code where this happens?

Guilherme Motta

unread,
Nov 28, 2013, 4:55:18 AM11/28/13
to codenameone...@googlegroups.com


Em quarta-feira, 27 de novembro de 2013 17h39min11s UTC-2, Shai Almog escreveu:
Where do you get that exception?
What do you do in the area of the code where this happens?

It's a simple form.
I want to get the text and put in a variable.

Guilherme Motta

unread,
Nov 28, 2013, 5:46:14 AM11/28/13
to codenameone...@googlegroups.com
Update: I changed the components names and now I've NullPointerException

Chen Fishbein

unread,
Nov 28, 2013, 5:56:29 AM11/28/13
to codenameone...@googlegroups.com
how do you expect to get help if you provide so little information?

Guilherme Motta

unread,
Nov 28, 2013, 6:11:09 AM11/28/13
to codenameone...@googlegroups.com


Em quinta-feira, 28 de novembro de 2013 08h56min29s UTC-2, Chen Fishbein escreveu:
how do you expect to get help if you provide so little information?

What you want? 

Chen Fishbein

unread,
Nov 28, 2013, 6:14:42 AM11/28/13
to codenameone...@googlegroups.com
1)the code that fails - just paste the function

2)the full stacktrace

Guilherme Motta

unread,
Nov 28, 2013, 6:26:08 AM11/28/13
to codenameone...@googlegroups.com


Em quinta-feira, 28 de novembro de 2013 09h14min42s UTC-2, Chen Fishbein escreveu:
1)the code that fails - just paste the function

2)the full stacktrace

protected void onCadastroUsuario_BtnCadatroUsuarioAction(Component c, ActionEvent event) {
        nome=findTxtCadUsuarioNome().getText();
        email=findTxtCadUsuarioEmail().getText();
        senha=findTxtCadUsuarioSenha().getText();
        cep=findTxtCadUsuarioCEP().getText();
        end=findTxtCadUsuarioEnd().getText();
        if(end.equals("") || nome.equals("")|| email.equals("") || senha.equals("") || cep.equals(""))
            Dialog.show("Favor", "preencher todos os campos", "OK",null);
        else
            showForm("Mapa", null);
    }

 In the simulator runs fine but in android occurs this Exception

Chen Fishbein

unread,
Nov 28, 2013, 6:29:25 AM11/28/13
to codenameone...@googlegroups.com
try like this:

        nome=findTxtCadUsuarioNome(c.getComponentForm()).getText();
        email=findTxtCadUsuarioEmail(c.getComponentForm()).getText();
        senha=findTxtCadUsuarioSenha(c.getComponentForm()).getText();
        cep=findTxtCadUsuarioCEP(c.getComponentForm()).getText();
        end=findTxtCadUsuarioEnd(c.getComponentForm()).getText();

the version without the parent should never be used.

Guilherme Motta

unread,
Nov 28, 2013, 7:10:25 AM11/28/13
to codenameone...@googlegroups.com
No, it don't work

Shai Almog

unread,
Nov 28, 2013, 2:46:24 PM11/28/13
to codenameone...@googlegroups.com
Did you override the theme for that screen?
Check if you have ovr files in the override directory.

Guilherme Motta

unread,
Nov 29, 2013, 6:32:31 AM11/29/13
to codenameone...@googlegroups.com
Yeah I have, can I delete this ovr?

Shai Almog

unread,
Nov 29, 2013, 1:05:11 PM11/29/13
to codenameone...@googlegroups.com
Yes.
Reply all
Reply to author
Forward
0 new messages