Is it ok to use airtime

4 respostas
A

Alguém sabe como tratar esse erro, ou melhor, como faço para não acontecer, eu clico em Yes ou No e não acontece nada.
Onde eu posso colocar a thred, já que devo mudar de lugar?

Vleu.

4 Respostas

K

Normalmente pondo a abertura de conexão dentro de Thread resolve esse problema, posta o código para a gente ver o que é.

A

Este é o código:

//	void testGET(String url) throws IOException {

//      HttpConnection connection = null;

//      InputStream is = null;

//      OutputStream os = null;

//      StringBuffer stringBuffer = new StringBuffer();

//      TextBox textBox = null;

//   	ContentConnection connection1 = (ContentConnection) Connector.open(url);
//      try {

//        ContentConnection connection = (ContentConnection) Connector.open(url);

//        InputStream iStrm = connection.openInputStream();

//        connection.setRequestMethod(HttpConnection.GET);

//        connection.setRequestProperty(“IF-Modified-Since”,“20 Jan 2001 16:19:14 GMT”);

//        connection.setRequestProperty(“User-Agent”,“Profile/MIDP-2.0 Confirguration/CLDC-1.1”);

//        connection.setRequestProperty(“Content-Language”, “en-CA”);

//        connection.setRequestProperty(“Content-Type”, “application/x-www-form-urlencoded”);

//        os = connection.openOutputStream();

//        is = connection.openDataInputStream();

/*          int ch;

while ((ch = is.read()) != -1) {

stringBuffer.append((char) ch);

}

textBox = new TextBox(“Teste simples de GET”, stringBuffer.toString(), 1024, 0);

} finally {

if(is!= null) {

is.close();

}

if(os != null) {

os.close();

}

if(connection != null) {

connection.close();

}

}*/

//      textBox = new TextBox(“Teste simples de GET”, stringBuffer.toString(), 1024, 0);

//  }
K

Embora eu não veje nenhuma Thread, vc tentar algo assim

new Thread(){
    public void run(){
        testGET("suaURL");
    }
}.start();

Isso já deve ser capaz de parar o bloqueio da mensagem de conexão do WTK, outro se vc quiser que a mensagem não apareça mais vá em Preferences do WTK e dentro de Security mude o Security Domain para maximum.Ah por favor sempre que for manda código ponha em volta de da tag Code para ficar melhor visivel.

A

bah tche, vleu.

Criado 7 de agosto de 2006
Ultima resposta 8 de ago. de 2006
Respostas 4
Participantes 2